Skip to content
Snippets Groups Projects
Commit 60aa3242 authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

document on how to run with compose in prod

parent 0f50e97d
No related branches found
No related tags found
No related merge requests found
Pipeline #132353 passed
......@@ -41,6 +41,16 @@ Run on kubernetes
Run in prod with docker compose
===============================================================================
.. toctree::
:maxdepth: 3
run_with_compose
Frequently Asked Questions
==========================
.. toctree::
......
......@@ -166,6 +166,7 @@ One command line is enough.
.. note::
| Press :kbd:`Ctrl` + :kbd:`C` to exit
.. _admin_container:
Administrate your container
------------------------------
......
.. _run_compose:
Running in production with docker compose
-------------------------------------------------
.. note::
We consider that you have configure previously a ``Dockerfile`` file according to instructions described in :ref:`Adapting the Dockerfile to your needs section<dockefile>`
We consider that you have configured the ``.gitlab-ci`` file, and your project is build images at each commit :ref:`according to the Setup the project<project_and_gitlab_ci>`
We consider that your computer/the server have docker and docker compose installed
Although our goal is to empower you to run your application in kubernetes, we here provide guidance on how to run it in production in a virtual machine.
In this section, you will define your settings related to your project, and then be able to run the image built by gitlab after the last commit.
Run the example
*************************************************
.. code-block:: bash
docker compose --env-file .example.env up
Configure your .env
*************************************************
In the `.env` file we provide example to run the compose :
Given a project hosted at # If your project is hosted at https://gitlab.pasteur.fr/ada-team/my-project/
where the production branch is named `main`, the file is:
.. code-block:: ini
CI_PROJECT_NAMESPACE=ada-team
CI_PROJECT_NAME=my-project
CI_REGISTRY=registry-gitlab.pasteur.fr
PROD_BRANCH=main
Run it
*************************************************
.. code-block:: bash
docker compose up -d
With private registry
*************************************************
You have to auth before starting the compose. Given a .auth file containing :
.. code-block:: ini
DEPLOY_USER=my-user
DEPLOY_TOKEN=not-secured-password
You should then do:
.. code-block:: bash
source .auth
source .env
echo $DEPLOY_TOKEN | docker login --username $DEPLOY_USER $CI_REGISTRY --password-stdin
docker compose up -d
more info can be found at https://docs.docker.com/reference/cli/docker/login/#password-stdin
Administrate your container
*************************************************
Information on how to manage the containers can be found at :ref:`admin_container`
\ No newline at end of file
.. _project_and_gitlab_ci:
Setup the project to run on Kubernetes
===============================================================================
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment