Skip to content

Commit

Permalink
+ compose sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
klaxalk committed Dec 3, 2024
1 parent 1190f4d commit 718e72c
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions docs/10-prerequisities/30-docker/40-compose-sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

<Button label="🔗 ctu-mrs/mrs_docker repository" link="https://github.com/ctu-mrs/mrs_docker" block /><br />

## Vanilla compose sessions

The _vanilla_ compose sessions are compsoe out of:

* `session.yaml`: the compose file
* `stack.env`: the environment variables definition
* `config/`: folder containing the custom configs
* `logs/`: folder where stdout logs are going to be stored
* `up.sh`, `down.sh`: scripts for easy starting / stopping of the simulation

0 comments on commit 718e72c

Please sign in to comment.