Skip to content

Running the project with Docker

This document will guide you on how to use Docker Compose with the provided configuration.

Running Docker Compose

To start the services defined in your docker-compose.yml file, you can use the following command in your terminal:

docker compose up

Effect of the --build option

If you need to ensure that your service images are rebuilt before they are started, you can use:

docker compose up --build

The --build option forces the images to be rebuilt. This is especially useful when you have made changes to the source code or configuration files that impact the image build. This way, you ensure that the latest changes are applied before the containers are started.

Effect of the -d option

Adding the -d option, the command becomes:

docker compose up -d

The -d (detached mode) option makes the services run in the background. This means you can continue using the terminal for other tasks while the containers are running in the background. Without this option, you will see the service logs being displayed in the terminal, and you will need to stop the process (Ctrl+C) to interrupt the execution.

Example Output of the docker compose ls Command

If you run the command:

docker compose ls

A breakdown of the services listed in the yaml will be displayed:

| NAME | IMAGE | SERVICE | STATUS | PORTS | |