How forstman1/inception-42 works
Project type and purpose
• This is a multi-container, Docker-compose based full-stack project (“Inception_42”) that demonstrates how to build and orchestrate a WordPress site (PHP-FPM + Nginx) backed by MariaDB, enhanced with Redis caching, managed via Adminer, served via FTP, and monitored by cAdvisor. It also includes a static “websites” bonus service and all Dockerfiles/configs live under srcs/requirements.
Key directories
• srcs/docker-compose.yml + .env – defines the services, networks, and volumes.
• srcs/requirements/<service> – each microservice lives in its own folder with a Dockerfile, .dockerignore, and tools (init scripts, configuration files).
– mariadb: database container and initialization scripts
– wordpress: PHP-FPM container, WP-CLI setup, configuration injection
– nginx: reverse-proxy / HTTPS termination container with OpenSSL certs
– redis: caching container for WP object cache
– adminer: DB-GUI container
– ftp: FTP server container for file uploads
– cadvisor: container monitoring agent
– bonus/websites: static site container
Main components & relationships
a. Docker Host & Engine
– Single Docker host running Docker Engine and Docker Compose
– A user-defined bridge network connects all containers.
b. Service containers
1. Nginx (port 80/443)
• HTTPS termination (self-signed via OpenSSL)
• reverse-proxies PHP requests to WordPress (FastCGI on port 9000)
• serves static files from shared volume (/var/www/html)
2. WordPress (PHP-FPM on port 9000)
• talks to MariaDB (TCP 3306) for persistent storage
• connects to Redis (TCP 6379) for object caching
• code/data shared via a named volume used by Nginx and FTP
3. MariaDB
• persistent data volume
• initialized via tools/script.sh and SQL scripts
4. Redis
• in-memory cache for WP
5. FTP
• exposes /var/www/html/files over FTP to manage uploads
6. Adminer
• DB admin UI → connects to MariaDB
7. cAdvisor
• monitors all containers via Docker API on port 8080
c. Volumes & Data flow
• wordpress_data – shared between WP, Nginx, FTP
• mariadb_data – holds database files
• named Redis volume if used (in-memory state)
d. Networks
• single Docker network for inter-container communication
• external port mappings (443 → nginx, 21 → ftp, 8080 → cadvisor, etc.)
Architectural patterns & design principles
• Microservices: each feature in its own container
• Single responsibility containers (DB, cache, web, proxy, monitoring, file transfer)
• Shared volumes for code and persistent data
• Clear orchestration via docker-compose.yml
• Environment-driven configuration via .env and startup scripts
• Use of FastCGI (PHP-FPM) pattern behind Nginx reverse proxy
• TLS termination at the edge (Nginx)