This project has been created as part of the 42 curriculum by [mamagalh].
This project, Inception, aims to broaden knowledge of system administration by using Docker to virtualize a complete network infrastructure. The goal is to set up a multi-container stack consisting of an NGINX server (TLS v1.2/v1.3), a WordPress instance powered by PHP-FPM, and a MariaDB database. Each service runs in its own dedicated container, built from scratch using Alpine Linux, ensuring a lightweight and secure environment.
The infrastructure is orchestrated using Docker Compose and managed via a Makefile. It includes:
- NGINX: The entry point for web traffic, handling HTTPS requests.
- WordPress: The content management system.
- MariaDB: The relational database for WordPress storage.
- Virtual Machines vs Docker: While VMs emulate hardware to run entire OS instances, Docker shares the host's kernel, making it much more resource-efficient and faster to deploy.
- Secrets vs Environment Variables: This project uses Docker Secrets to handle sensitive data like database passwords. Secrets are more secure than environment variables because they are not stored in the image or visible in
docker inspect, being mounted only in memory at/run/secrets/. - Docker Network vs Host Network: A dedicated
webnetbridge network is used instead of the host network. This provides isolation and allows containers to communicate via service names (DNS) while preventing direct exposure of internal services to the host network. - Docker Volumes vs Bind Mounts: We use Docker Volumes with specific device paths (
/home/${LOGNAME}/data) to ensure data persistence for MariaDB and WordPress. This combines the performance of bind mounts with the management benefits of Docker volumes.
- Compilation & Installation: Run
makein the root directory. This will check for secrets, generate SSL certificates, create necessary data directories, and build the containers. - Execution: The
makecommand automatically starts the services in detached mode. - Rebuild: Use
make reto restart and rebuild the services.
- Docker Documentation
- Alpine Linux Packages
- WordPress CLI Documentation
- Container knowlage
- AI Usage: AI was used to assist in the generation of documentation structure.