Inception is a system administration and Docker infrastructure project that builds a complete web application stack using Docker Compose. The project involves setting up a multi-container environment with NGINX, WordPress, MariaDB, and several bonus services, all running in isolated Docker containers with custom configurations. Each service runs in its own container built from Debian Bullseye base images, demonstrating infrastructure-as-code principles and containerization best practices.
This project emphasizes understanding Docker networking, volume management, service orchestration, and secure configuration of production-grade web services.
• Multi-Container Architecture: Orchestrated stack of 8 services using Docker Compose
• Custom Docker Images: All services built from penultimate stable Debian (Bullseye)
• TLS/SSL Security: NGINX configured with TLSv1.3 and self-signed certificates
• Persistent Storage: Docker volumes with local bind mounts for data persistence
• WordPress CMS: Full WordPress installation with WP-CLI automation
• Database Management: MariaDB with secure installation and user management
• Redis Caching: WordPress object caching with Redis integration
• FTP Server: vsftpd for secure file transfers to WordPress volume
• Database GUI: Adminer for web-based database administration
• Container Monitoring: cAdvisor for real-time resource usage monitoring
• Static Website: Additional static site served on separate port
• Environment Variables: Secure configuration through .env file
• Automated Setup: Complete infrastructure provisioning with single command
1. NGINX (Port 443, 8081)
- Reverse proxy with TLSv1.3 encryption
- Serves WordPress via FastCGI (PHP-FPM)
- Static website hosting on port 8081
- Self-signed SSL certificates
- Custom domain name configuration
2. WordPress (Port 9000)
- PHP 7.4-FPM with FastCGI
- WP-CLI for automated installation
- Two users (admin + regular user)
- Redis object caching enabled
- Persistent volume storage
3. MariaDB (Port 3306)
- Database server for WordPress
- Automated secure installation
- Custom database and user creation
- Data persistence via volume
- Network isolation (not exposed externally)
4. Redis (Port 6379)
- WordPress object caching
- php-redis extension
- Improves WordPress performance
5. FTP Server (Port 21)
- vsftpd daemon
- Access to WordPress volume
- User authentication via environment variables
6. Static Website (Port 8081)
- Simple static HTML site
- Separate from WordPress
- Demonstrates multi-service hosting
7. Adminer (Port 3307)
- Lightweight database management interface
- Web-based MariaDB administration
- Alternative to phpMyAdmin
8. cAdvisor (Port 8080)
- Container resource monitoring
- Real-time performance metrics
- CPU, memory, network, disk statistics
- Docker Engine
- Docker Compose
- GNU Make
- Linux/Unix system (tested on Debian-based distributions)
git clone https://github.com/whoismtrx/42_Inception.git inception
cd inception
makeCreate a .env file in srcs/ directory with the following variables:
# Domain
DOMAIN_NAME=your-login.42.fr
# MariaDB
MARIADB_DATABASE=wordpress
MARIADB_USER=wpuser
MARIADB_USER_PASSWORD=secure_password
MARIADB_ROOT_PASSWORD=root_password
# WordPress Admin
WORDPRESS_ADMIN=admin
WORDPRESS_ADMIN_PASSWORD=admin_password
WORDPRESS_ADMIN_EMAIL=admin@example.com
# WordPress User
WORDPRESS_USER=user
WORDPRESS_USER_EMAIL=user@example.com
WORDPRESS_USER_PASSWORD=user_password
# FTP
FTP_USER=ftpuser
FTP_PASSWORD=ftp_passwordOnce running, access the services at:
- WordPress:
https://your-login.42.fr - Static Website:
http://localhost:8081 - Adminer:
http://localhost:3307 - cAdvisor:
http://localhost:8080 - FTP:
ftp://localhost:21
# Stop all containers
make stop
# Stop containers and remove volumes
make stop_volume
# Clean everything (containers, images, volumes)
make clean
# Rebuild and restart
make re- TLS Version: TLSv1.3 only (most secure)
- SSL Certificate: Self-signed (generated during build)
- FastCGI: Proxies PHP requests to WordPress container
- Virtual Hosts: Supports multiple server blocks
- Static Files: Serves static content efficiently
Automated using WP-CLI:
- Downloads latest WordPress core
- Creates
wp-config.phpwith database credentials - Installs WordPress with admin user
- Creates additional regular user
- Configures Redis caching
- Installs and activates Redis Cache plugin
- Sets proper file permissions
Automated secure installation:
- Removes anonymous users
- Disables remote root login
- Removes test database
- Creates WordPress database and user
- Grants appropriate privileges
- Binds to all interfaces for container networking
Two persistent volumes:
- mariadb: Stores database files at
/home/orekabe/data/mariadb - wordpress: Stores WordPress files at
/home/orekabe/data/wordpress
Volumes use local driver with bind mounts for data persistence across container restarts.
All services run on the inception network:
- Internal DNS resolution (services communicate by container name)
- Isolated from host network (except exposed ports)
- MariaDB and Redis not exposed externally (security best practice)
Each Dockerfile follows best practices:
- Based on Debian Bullseye (stable)
- Minimal layers for smaller image size
- No
latesttags (version pinning) - Services run as foreground processes
- Health checks and restart policies
nginx → wordpress → mariadb
↓
redis
ftp → wordpress volume
adminer → mariadb
cadvisor → all containers
- TLSv1.3 encryption for HTTPS
- No hardcoded passwords (environment variables)
- Database not exposed to host
- Secure MariaDB installation
- Container isolation
- Least privilege principle
inception/
├── Makefile # Build and deployment automation
├── srcs/
│ ├── docker-compose.yml # Service orchestration
│ ├── .env # Environment variables (not in repo)
│ └── requirements/
│ ├── mariadb/
│ │ ├── Dockerfile
│ │ └── tools/
│ │ ├── MariaDB_Script
│ │ └── Mysql_Secure_Installation.exp
│ ├── wordpress/
│ │ ├── Dockerfile
│ │ ├── conf/www.conf
│ │ └── tools/WordPress_Script
│ ├── nginx/
│ │ ├── Dockerfile
│ │ └── conf/nginx.conf
│ └── bonus/
│ ├── redis/
│ │ ├── Dockerfile
│ │ └── tools/Redis_Script
│ ├── ftp/
│ │ ├── Dockerfile
│ │ ├── config/vsftpd.conf
│ │ └── tools/Ftp_Script
│ ├── adminer/
│ │ └── Dockerfile
│ ├── cadvisor/
│ │ └── Dockerfile
│ └── static_website/
│ ├── Dockerfile
│ └── tools/index.html
└── data/ # Volume mount points (created by Makefile)
├── mariadb/
└── wordpress/
This repository is for educational purposes only, documenting my work on the 42 curriculum. These solutions are intended as a reference for students who have already completed or are actively working on the project.