Common Docker Commands
This section provides a reference for common Docker commands used in this project.
Starting the Application
To start the application in development mode with hot-reloading, use the run.sh script:
This is the recommended way to start the application for development.
Alternatively, you can use docker compose directly:
To start the application in production mode, use the docker-compose.prod.yaml file:
Stopping the Application
To stop the application, you can use Ctrl+C in the terminal where the application is running if you did not use the -d flag.
If you used the -d flag to run the application in detached mode, you can stop it with:
or for production:
The run.sh script has a cleanup function that automatically runs docker compose -f docker-compose.dev.yaml down on exit.
Viewing Logs
To view the logs of all running services, you can use the following command:
To view the logs of a specific service, you can specify the service name:
For example, to view the logs of the data-collection-service:
Executing Commands in Services
You can execute commands inside a running service container using docker compose exec.
For example, to open a shell in the data-collection-service container:
This is useful for debugging and running commands within the context of a specific service.
Running One-off Commands
To run a one-off command in a service container, you can use docker compose run. This is particularly useful for tasks like running tests or database migrations.
For example, to run pytest in the data-collection-service:
The --rm flag automatically removes the container after the command exits.