Note:
secrets/is gitignored and not included in this repo. Create it locally before running the stack (see Setup).
A multi-container Docker infrastructure deploying a WordPress site with NGINX, MariaDB, and Adminer — all orchestrated with Docker Compose.
This project sets up a complete web stack inside a virtual machine using only custom-built Docker images (no pre-built images from Docker Hub for core services). Each service runs in its own container and communicates over a dedicated Docker network.
Browser (HTTPS)
│
▼
[ NGINX ] ──── TLSv1.2 / TLSv1.3 only ──── port 443
│
▼
[ WordPress + php-fpm ]
│
▼
[ MariaDB ] [ Adminer ] ──── port 8080
Shared Docker network: inception
| Service | Role |
|---|---|
| NGINX | Reverse proxy, TLS termination (1.2 / 1.3) |
| WordPress | CMS running with php-fpm (no NGINX inside) |
| MariaDB | Relational database for WordPress |
| Adminer | (Bonus) Web-based database management UI |
- All core images built from scratch using custom Dockerfiles (Alpine-based)
- TLS-only access via NGINX — HTTP is not exposed
- Docker secrets for sensitive credentials (DB passwords, WP admin password)
- Named volumes with host bind mounts for persistent data
restart: alwayspolicy on all containers- Single
make runcommand to build and start the full stack
inception/
├── Makefile
├── srcs/
│ ├── docker-compose.yml
│ ├── .env
│ └── requirements/
│ ├── nginx/
│ ├── wordpress/
│ └── mariadb/
│ └── bonus/
│ └── adminer/
└── secrets/
├── certs/
├── db_password.txt
├── db_root_password.txt
└── wp_admin_password.txt
- Docker and Docker Compose installed
- Certificates generated and placed in
secrets/certs/ - Host entry added for
wlucke.42.fr
# Create the secrets directory and password files
mkdir -p secrets/certs
echo "your_db_password" > secrets/db_password.txt
echo "your_db_root_password" > secrets/db_root_password.txt
echo "your_wp_admin_password" > secrets/wp_admin_password.txt
# Generate self-signed TLS certificate
make certs
# Create data directories and set permissions
make dirs
# Add hostname to /etc/hosts
make hosts# Build images and start all containers
make run
# Or step by step:
make build
make upmake down # Stop and remove containers
make restart # Restart all services
make logs # Tail logs from all containers
make clean # Stop containers and remove volumes
make re # Full rebuild from scratch
make adminer # Start the Adminer bonus containermake send # rsync project to VM over SSH
make ssh # SSH into VM
make firefox # Open Firefox on VM via X forwardingAdminer is a lightweight, single-file database management tool. It runs in its own container on port 8080 and connects to the MariaDB container over the inception network.
make adminer # Start Adminer
make adminer_clean # Stop and remove Adminer container| Volume | Mount path on host |
|---|---|
wordpress_data |
/home/<user>/data/wordpress |
mariadb_data |
/home/<user>/data/mariadb |
- Secrets passed to containers via Docker secrets (files), not environment variables
- TLS certificates stored in
secrets/certs/and mounted read-only into NGINX - NGINX configured to accept TLSv1.2 and TLSv1.3 only