This project uses Docker and Docker Compose to manage the development environment. The Makefile
provides a set of commands to build, start, stop, and manage the Docker containers.
It's designed to be used with a Python application and includes a MySQL database (MariaDB) and RabbitMQ for message queuing.
- Docker
- Docker Compose
- Make
- awk
- gawk
This command is a placeholder and does not perform any actions. It is included for completeness.
Displays the current user ID, group ID, and target architecture.
Builds the Docker images with the appropriate architecture.
Runs the pre-up
and build
commands, then starts the Docker containers in detached mode.
Stops and removes the Docker containers, volumes, and images.
Stops the Docker containers without removing them.
Displays the status of the Docker containers.
Starts the Docker containers, Builds the images with the appropriate architecture.
-
Build and start the containers:
make up
-
Stop and remove the containers, volumes, and images:
make down
-
Stop the containers without removing them:
make stop
-
Display the status of the containers:
make status
-
Set up the project:
make setup
-
Display the current user ID, group ID, and target architecture:
make pre-up
-
Build the Docker images:
make build
The RabbitMQ service is included in the Docker Compose file. It is used for message queuing and can be configured as needed.
The Python application is set up to use the python:3.11
slim image.
The Python consumer is set up to use the python:3.11
slim image.
It is designed to consume messages from RabbitMQ and process them.
The consumer is set up to run in a separate container and can be configured as needed.
The docker-compose.yml
file defines the service, and the Dockerfile
is used to build the image.
Launch is delayed to ensure that the RabbitMQ service is up and running before the consumer container starts (using healthcheck status).
The MySQL service is set up to use the mariadb:latest
image.
The db
directory is used to load the database schema and data when the MySQL container is started.
- The
.sql
file is used to create the database schema.
The docker-compose.yml
file defines the services, networks, and volumes used in the project.
Can be used to start the application and database containers + rabbitmq (can be commented or adapted to other messaging queues if needed).
The Dockerfile
is used to build the Docker images for the application. It includes the following steps:
- Set the base image to
python:3.11-slim
. - Install required packages.
Provided requirements.txt file is only as a placeholder, you can adapt it to your needs.
src
folder contains basic example files which are only here to illustrate the usage of the Docker setup.- Ensure that Docker and Docker Compose are installed and running on your system.
- The
CURRENT_UID
andCURRENT_GID
environment variables are used to set the file ownership inside the Docker containers to match the host user.