diff --git a/docs/10-prerequisities/30-docker/40-compose-sessions.md b/docs/10-prerequisities/30-docker/40-compose-sessions.md index 2a905578..b78443bf 100644 --- a/docs/10-prerequisities/30-docker/40-compose-sessions.md +++ b/docs/10-prerequisities/30-docker/40-compose-sessions.md @@ -5,3 +5,59 @@ description: How to run Docker compose sessions --- # Compose sessions + +Compose sessions are a convenient way of launching multiple containers in a pre-determined way. +A compose session is defined by a `yaml` file, that precribes the containers as `service`. +Each `service` have the following parameters: + +* source docker image, +* mounted network volumes, +* mounted network interfaces, +* environment variables, +* network port mapping, +* entrypoint, +* base command. + +## Starting the compose session + +```bash +docker compose up +``` + +When environment variables are provided from a file, start the session as + +```bash +docker compose --env-file ./stack.env up +``` + +## Stopping the the session + +```bash +docker compose down +``` + +When environment variables are provided from a file, stop the session as + +```bash +docker compose --env-file ./stack.env down +``` + +Additional arguments: +* `--v`, `--volumes`: remove declared volumes +* `--remove-orphans`: remove containers not defined in the compose file + +## Compose session for the MRS System + +The compose sessions are available at the [ctu-mrs/mrs_docker](https://github.com/ctu-mrs/mrs_docker). + +