From 0a0ab771d24b3789027933cf5b094b2173a71b53 Mon Sep 17 00:00:00 2001
From: Jeff Vincent <153767405+jvincent-mongodb@users.noreply.github.com>
Date: Fri, 13 Dec 2024 14:02:39 -0800
Subject: [PATCH] DOCSP-45301 -- Add checklist and examples for converting from
official image to local dev image (#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 464319abf0760b04f8936d57f6dab90fcf1f54ec)
---
source/atlas-cli-deploy-docker.txt | 59 ++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
diff --git a/source/atlas-cli-deploy-docker.txt b/source/atlas-cli-deploy-docker.txt
index 2c7c4a0e..28d1e0b3 100644
--- a/source/atlas-cli-deploy-docker.txt
+++ b/source/atlas-cli-deploy-docker.txt
@@ -109,6 +109,13 @@ Create a Local Atlas Deployment with Docker Compose
Create a local |service| deployment with `Docker Compose
`__.
+
+.. note::
+
+ If you have an existing Docker-Compose based Atlas implementation that you've
+ built with the official `MongoDB Docker Image `__
+ and that you'd like to convert to use the Atlas Local Dev image,
+ see :ref:`Convert to a Local Dev Implementation ` below.
.. procedure::
:style: normal
@@ -372,3 +379,55 @@ directory:
sudo dpkg -i mongosh.deb
mongosh --version
- run: mongosh 'mongodb://localhost/?directConnection=true' --eval 'show dbs'
+
+
+.. _convert-to-local-dev:
+
+Convert Official Image to a Local Atlas Deployment
+--------------------------------------------------
+
+If you have an existing |service| implementation running in Docker Compose that
+you have built with the official `mongo `__ Docker
+image, you can refer to the following checklist to simplify converting it to
+the `mongodb-atlas-local `__ image.
+
+1. Remove any existing ``command`` from your ``docker-compose.yaml`` file. Because
+ the ``command`` in a Docker Compose definition overrides the ``ENTRYPOINT``
+ defined in the ``mongodb-atlas-local`` image, you must remove any existing
+ ``command`` for the ``mongodb-atlas-local`` image to run as designed.
+
+2. There is no need to define a health check for the |service| deployment, as this
+ feature is built in to the ``mongodb-atlas-local`` image.
+
+Example Docker Compose Updates
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The following examples illustrate the likely required changes to your Docker
+Compose YAML file:
+
+.. code-block:: yaml
+
+ services:
+ self_built_atlas_implementation:
+ image: mongo:8.0
+ ports:
+ - 27017:27017
+ command: ["./entrypoint.sh"] # You may have defined a health check for the database in the entrypoint script.
+
+.. code-block:: yaml
+
+ services:
+ local_dev_atlas:
+ image: mongodb/mongodb-atlas-local:8.0
+ hostname: local_dev_atlas
+ ports:
+ - 27017:27017
+ environment:
+ - MONGODB_INITDB_ROOT_USERNAME=user
+ - MONGODB_INITDB_ROOT_PASSWORD=pass
+ volumes:
+ - data:/data/db
+ - config:/data/configdb
+ volumes:
+ - data:
+ - config:
\ No newline at end of file