This project has been created as part of the 42 curriculum by elsikira.
The Inception project is a systemic introduction to virtualization and containerization. The goal is to set up a small infrastructure composed of several services—NGINX, WordPress, and MariaDB—orchestrated via Docker Compose.
Every service runs in a dedicated container, ensuring a microservices architecture that is secure, portable, and easily reproducible. This project emphasizes manual configuration: all images are built from a debian:bookworm base without using pre-made images from Docker Hub.
The project is structured into a srcs/ directory containing:
docker-compose.yml: The orchestrator linking services, networks, and volumes.requirements/: Dedicated subdirectories for each service, containing theirDockerfile, configuration files, and entrypoint scripts..env: Centralized configuration for ports, credentials, and persistent paths.
Main Design Choices:
- Dynamic Port Injection: Utilizing
envsubstandsed, the stack injects ports at runtime. This allows the infrastructure to be remapped to any port (e.g., changing NGINX from 443 to 1234) via a single variable change in the.envfile. - Security First: NGINX is configured with TLS 1.3. Services like MariaDB and WordPress are isolated within a private Docker network, unreachable from the host except through the NGINX gateway.
- Persistence: Data is maintained through volume mapping to ensure that database entries and website files survive container restarts or removals.
| Topic | Comparison |
|---|---|
| VM vs Docker | VMs virtualize hardware (including an entire OS), making them heavy and slow. Docker virtualizes the OS kernel, allowing containers to share the host's resources, making them lightweight and fast. |
| Secrets vs Env Vars | Environment Variables are stored in plain text and visible via docker inspect. Secrets (often used in Swarm or via specific secure mounts) are more secure as they are encrypted or kept in-memory. |
| Docker Network vs Host Network | Host networking makes the container share the host's IP/ports directly (less secure). Docker networks create a private, isolated bridge where containers communicate only by service name. |
| Docker Volumes vs Bind Mounts | Bind mounts point to a specific host path (linked to host file structure). Docker Volumes are managed by Docker itself, making them more portable and abstracted from the host's filesystem. |
- Setup: Ensure
makeanddockerare installed on your host machine. - Domain: Add
127.0.0.1 elsikira.42.frto your/etc/hostsfile. - Execution: Run
makefrom the root of the repository. This will:- Create the necessary data folders on your host.
- Build the custom images.
- Launch the containers in detached mode.
- Cleanup: Use
make fcleanto stop containers and delete all persistent data.
AI Usage: AI (Gemini) was used as a pedagogical collaborator for the following tasks:
- Clarifying core Docker concepts and network isolation logic.
- Developing the "Zero Hardcode" strategy for internal networking via dynamic environment variables.
- Structuring and refining documentation to ensure compliance with project requirements.