This infrastructure provides a complete web hosting stack with three isolated containers:
- NGINX: entry point for the website, handles HTTPS traffic and serves/reverse-proxies requests.
- WordPress (PHP-FPM): CMS application where the site is configured and managed.
- MariaDB: database engine that stores WordPress content and user data.
All services communicate through an internal Docker network.
The project is controlled by the root Makefile.
From the repository root:
makeThis builds images (if needed) and starts the stack.
make downmake clean # stop stack and remove named volumes
make fclean # full cleanup (containers, images, volumes, and host data directories)Before opening the website, add this line to your host /etc/hosts:
127.0.0.1 anikitin.42.fr
https://anikitin.42.fr
https://anikitin.42.fr/wp-admin
Browser note: because this setup commonly uses a self-signed certificate, your browser may show a warning page. Accept the warning to continue.
HTTP (:80) is not exposed in this project; use HTTPS.
Sensitive credentials are stored in secrets/:
secrets/credentials.txt(WordPress admin/user setup values)secrets/db_password.txt(MariaDB user password)secrets/db_root_password.txt(MariaDB root password)
Non-sensitive runtime configuration is in srcs/.env:
- domain and URL (
DOMAIN_NAME,WP_URL) - database connection settings (
DB_NAME,DB_USER,DB_HOST) - WordPress title (
WP_TITLE)
Security recommendations:
- do not commit real secret values to public repositories;
- rotate credentials by updating secret files, then recreate affected containers.
List running services:
docker compose -f srcs/docker-compose.yml --env-file srcs/.env psExpected result: nginx, wordpress, and mariadb are Up.
Check logs (all services):
make logsCheck logs (single service):
docker compose -f srcs/docker-compose.yml --env-file srcs/.env logs nginxValidate HTTPS endpoint:
curl -kI https://anikitin.42.frOptional HTTP check (should fail because port 80 is not exposed):
curl -I http://anikitin.42.fr