- Docker Engine
- Docker Compose v2
- GNU Make
- A Linux virtual machine that can use the host paths required by the Makefile
- Compose file:
srcs/docker-compose.yml - Local non-sensitive configuration:
srcs/.env - Secrets directory:
secrets/
The stack reads passwords from Docker secrets mounted from files:
secrets/db_password.txtsecrets/db_root_password.txtsecrets/wp_admin_password.txtsecrets/wp_user_password.txt
Keep real values out of the repository. The secrets/ directory is git-ignored and must be created from secrets.example/.
The root Makefile is the supported entry point:
make # first build and run
make down # stop all containers
make restart # restart the stack
make rebuild # full teardown + rebuildUnder the hood, the Makefile runs docker compose -f srcs/docker-compose.yml ....
- Status:
docker ps - Logs:
docker logs nginx,docker logs wordpress,docker logs mariadb - Shell access:
docker exec -it nginx sh,docker exec -it wordpress sh,docker exec -it mariadb sh
- View the resolved configuration:
docker compose -f srcs/docker-compose.yml config - Restart a single service:
docker compose -f srcs/docker-compose.yml restart wordpress
The project uses named volumes with bind mount driver options so the host filesystem stores the data directly:
wordpress_data->/home/mobouifr/data/www->/var/www/htmldb_data->/home/mobouifr/data/mariadb->/var/lib/mysql
Because persistence lives on the host, rebuilding images does not erase content unless the host data directories are removed.
srcs/docker-compose.yml: service definitions for NGINX, WordPress, and MariaDBsrcs/requirements/nginx/: NGINX Dockerfile and TLS configurationsrcs/requirements/wordpress/: WordPress + PHP-FPM Dockerfile and setup scriptssrcs/requirements/mariadb/: MariaDB Dockerfile and initialization scriptssecrets/: runtime secret files mounted into the containers
- Network isolation comes from the custom bridge network
my-net; services discover each other by name. - Sensitive values are kept in Docker secrets instead of inline environment variables.
- Persistent data uses host-backed named volumes so the state survives container recreation.
- NGINX is the only public entrypoint and should remain the only service publishing a host port.