Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation


📖 About

Inception is a system administration project from the 42 School curriculum. The goal is to set up a small infrastructure composed of multiple Docker containers, each running a single service, orchestrated with Docker Compose. No pre-built images from Docker Hub are allowed — every Dockerfile must be written from scratch using Debian as the base image.


🏗️ Architecture

                       ┌─────────────────┐
                       │    Client        │
                       │  (Browser)       │
                       └────────┬────────┘
                                │ HTTPS :443
                       ┌────────▼────────┐
                       │     Nginx       │
                       │  TLSv1.2/1.3    │
                       │  Reverse Proxy  │
                       └────────┬────────┘
                                │ :9000 (FastCGI)
                       ┌────────▼────────┐
                       │   WordPress     │
                       │   + PHP-FPM     │
                       │   + WP-CLI      │
                       └────────┬────────┘
                                │ :3306
                       ┌────────▼────────┐
                       │    MariaDB      │
                       │   Database      │
                       └─────────────────┘

  Volumes:  ┌─────────────┐    ┌─────────────┐
            │  wp_data    │    │  db_data    │
            │ (WordPress  │    │ (MariaDB    │
            │  files)     │    │  storage)   │
            └─────────────┘    └─────────────┘

✨ Features

Requirement Implementation
No pre-built images All Dockerfiles built from debian:bullseye
One service per container Nginx, WordPress, MariaDB — each isolated
TLS only Nginx configured with TLSv1.2 / TLSv1.3, self-signed certificate
WordPress + PHP-FPM Installed and configured via WP-CLI (no web installer)
MariaDB Database initialized with setup script, users created automatically
Persistent storage Two Docker volumes for WordPress files and database data
Docker network All containers communicate through an internal Docker network
Environment variables Secrets managed via .env file (never committed)
Auto-restart Containers configured to restart on failure

📁 Project Structure

Inception/
├── srcs/
│   ├── docker-compose.yml           # Service orchestration
│   └── requirements/
│       ├── nginx/
│       │   ├── Dockerfile           # Debian + Nginx + SSL setup
│       │   └── conf/               # Nginx server configuration
│       ├── wordpress/
│       │   ├── dockerfile           # Debian + PHP-FPM + WP-CLI
│       │   └── conf/               # PHP-FPM & WordPress config
│       └── mariadb/
│           ├── Dockerfile           # Debian + MariaDB server
│           ├── conf/               # MariaDB configuration
│           └── tools/              # DB initialization scripts
└── Makefile                         # Build & manage shortcuts

🛠️ Services

🔒 Nginx

  • Serves as the only entry point (port 443)
  • TLSv1.2 / TLSv1.3 with self-signed certificate
  • Reverse proxy to WordPress via FastCGI on port 9000

📝 WordPress

  • Installed via WP-CLI (automated, no manual setup)
  • Runs with PHP-FPM (no Apache)
  • Two users created automatically (admin + regular user)
  • Connected to MariaDB for data persistence

🗄️ MariaDB

  • Database server with automated initialization
  • User and database creation via entrypoint script
  • Data persisted on a dedicated Docker volume

🚀 Getting Started

Prerequisites

  • Docker & Docker Compose
  • Make

Build & Run

# Clone the repository
git clone https://github.com/Wesper-Dev/Inception.git
cd Inception

# Create your environment file
cp .env.example .env
# Edit .env with your credentials

# Build and launch all containers
make

# Stop all containers
make down

# Clean everything (containers, volumes, images)
make fclean

Environment Variables

Variable Description
DOMAIN_NAME Your domain (e.g., adurand.42.fr)
MYSQL_ROOT_PASSWORD MariaDB root password
MYSQL_USER WordPress database user
MYSQL_PASSWORD WordPress database password
MYSQL_DATABASE WordPress database name
WP_ADMIN_USER WordPress admin username
WP_ADMIN_PASSWORD WordPress admin password
WP_ADMIN_EMAIL WordPress admin email
WP_USER WordPress regular user
WP_USER_PASSWORD WordPress regular user password
WP_USER_EMAIL WordPress regular user email

📚 Key Concepts Learned

  • Containerization — Building Docker images from scratch (no pre-built)
  • Service isolation — One process per container philosophy
  • Docker networking — Inter-container communication via internal networks
  • TLS/SSL — Certificate generation and HTTPS enforcement
  • Infrastructure as Code — Reproducible environments with Docker Compose
  • Process management — PID 1, signal handling, graceful shutdown
  • Volume persistence — Data survival across container restarts

About

42 Docker project: NGINX, WordPress and MariaDB, with dedicated Dockerfiles, persistent volumes and a container network.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages