Skip to content

Commit 9348a0c

Browse files
DOCSP-45301 -- Add checklist and examples for converting from official image to local dev image (#783) (#789)
* DOCSP-45301 -- Add checklist and examples for converting from official image to local dev image * DOCSP-45301 -- edit example yaml * DOCSP-45301 -- external review revisions * DOCSP-45301 -- copy review revisions * DOCSP-45301 -- external review revisions (cherry picked from commit 464319a)
1 parent df19c2a commit 9348a0c

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

source/atlas-cli-deploy-docker.txt

+59
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,13 @@ Create a Local Atlas Deployment with Docker Compose
169169

170170
Create a local |service| deployment with `Docker Compose
171171
<https://docs.docker.com/compose/>`__.
172+
173+
.. note::
174+
175+
If you have an existing Docker-Compose based Atlas implementation that you've
176+
built with the official `MongoDB Docker Image <https://hub.docker.com/_/mongo>`__
177+
and that you'd like to convert to use the Atlas Local Dev image,
178+
see :ref:`Convert to a Local Dev Implementation <convert-to-local-dev>` below.
172179

173180
.. procedure::
174181
:style: normal
@@ -432,3 +439,55 @@ directory:
432439
sudo dpkg -i mongosh.deb
433440
mongosh --version
434441
- run: mongosh 'mongodb://localhost/?directConnection=true' --eval 'show dbs'
442+
443+
444+
.. _convert-to-local-dev:
445+
446+
Convert Official Image to a Local Atlas Deployment
447+
--------------------------------------------------
448+
449+
If you have an existing |service| implementation running in Docker Compose that
450+
you have built with the official `mongo <https://hub.docker.com/_/mongo>`__ Docker
451+
image, you can refer to the following checklist to simplify converting it to
452+
the `mongodb-atlas-local <https://hub.docker.com/r/mongodb/mongodb-atlas-local>`__ image.
453+
454+
1. Remove any existing ``command`` from your ``docker-compose.yaml`` file. Because
455+
the ``command`` in a Docker Compose definition overrides the ``ENTRYPOINT``
456+
defined in the ``mongodb-atlas-local`` image, you must remove any existing
457+
``command`` for the ``mongodb-atlas-local`` image to run as designed.
458+
459+
2. There is no need to define a health check for the |service| deployment, as this
460+
feature is built in to the ``mongodb-atlas-local`` image.
461+
462+
Example Docker Compose Updates
463+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
464+
465+
The following examples illustrate the likely required changes to your Docker
466+
Compose YAML file:
467+
468+
.. code-block:: yaml
469+
470+
services:
471+
self_built_atlas_implementation:
472+
image: mongo:8.0
473+
ports:
474+
- 27017:27017
475+
command: ["./entrypoint.sh"] # You may have defined a health check for the database in the entrypoint script.
476+
477+
.. code-block:: yaml
478+
479+
services:
480+
local_dev_atlas:
481+
image: mongodb/mongodb-atlas-local:8.0
482+
hostname: local_dev_atlas
483+
ports:
484+
- 27017:27017
485+
environment:
486+
- MONGODB_INITDB_ROOT_USERNAME=user
487+
- MONGODB_INITDB_ROOT_PASSWORD=pass
488+
volumes:
489+
- data:/data/db
490+
- config:/data/configdb
491+
volumes:
492+
- data:
493+
- config:

0 commit comments

Comments
 (0)