Skip to content

Commit b01a83f

Browse files
DOCSP-45301 -- Add checklist and examples for converting from official image to local dev image (mongodb#783)
* 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 e1cb77a commit b01a83f

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
@@ -109,6 +109,13 @@ Create a Local Atlas Deployment with Docker Compose
109109

110110
Create a local |service| deployment with `Docker Compose
111111
<https://docs.docker.com/compose/>`__.
112+
113+
.. note::
114+
115+
If you have an existing Docker-Compose based Atlas implementation that you've
116+
built with the official `MongoDB Docker Image <https://hub.docker.com/_/mongo>`__
117+
and that you'd like to convert to use the Atlas Local Dev image,
118+
see :ref:`Convert to a Local Dev Implementation <convert-to-local-dev>` below.
112119

113120
.. procedure::
114121
:style: normal
@@ -372,3 +379,55 @@ directory:
372379
sudo dpkg -i mongosh.deb
373380
mongosh --version
374381
- run: mongosh 'mongodb://localhost/?directConnection=true' --eval 'show dbs'
382+
383+
384+
.. _convert-to-local-dev:
385+
386+
Convert Official Image to a Local Atlas Deployment
387+
--------------------------------------------------
388+
389+
If you have an existing |service| implementation running in Docker Compose that
390+
you have built with the official `mongo <https://hub.docker.com/_/mongo>`__ Docker
391+
image, you can refer to the following checklist to simplify converting it to
392+
the `mongodb-atlas-local <https://hub.docker.com/r/mongodb/mongodb-atlas-local>`__ image.
393+
394+
1. Remove any existing ``command`` from your ``docker-compose.yaml`` file. Because
395+
the ``command`` in a Docker Compose definition overrides the ``ENTRYPOINT``
396+
defined in the ``mongodb-atlas-local`` image, you must remove any existing
397+
``command`` for the ``mongodb-atlas-local`` image to run as designed.
398+
399+
2. There is no need to define a health check for the |service| deployment, as this
400+
feature is built in to the ``mongodb-atlas-local`` image.
401+
402+
Example Docker Compose Updates
403+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
404+
405+
The following examples illustrate the likely required changes to your Docker
406+
Compose YAML file:
407+
408+
.. code-block:: yaml
409+
410+
services:
411+
self_built_atlas_implementation:
412+
image: mongo:8.0
413+
ports:
414+
- 27017:27017
415+
command: ["./entrypoint.sh"] # You may have defined a health check for the database in the entrypoint script.
416+
417+
.. code-block:: yaml
418+
419+
services:
420+
local_dev_atlas:
421+
image: mongodb/mongodb-atlas-local:8.0
422+
hostname: local_dev_atlas
423+
ports:
424+
- 27017:27017
425+
environment:
426+
- MONGODB_INITDB_ROOT_USERNAME=user
427+
- MONGODB_INITDB_ROOT_PASSWORD=pass
428+
volumes:
429+
- data:/data/db
430+
- config:/data/configdb
431+
volumes:
432+
- data:
433+
- config:

0 commit comments

Comments
 (0)