This project has been created as part of the 42 curriculum by nrasamim.
The Inception project is a System Administration and Architecture exercise focused on designing a robust, containerized environment. The goal was to build and manage a microservices-based infrastructure where each service is isolated, secure, and highly maintainable.
The infrastructure includes:
- A NGINX container serving as the sole entry point via port 443 with TLSv1.2/v1.3.
- A WordPress website powered by php-fpm.
- A MariaDB database to store website content.
The following design comparisons illustrate the technical choices made:
-
Virtual Machines vs. Docker: While VMs virtualize the hardware level to run multiple OSs, Docker virtualizes the OS level to run multiple isolated applications (containers), making it much more lightweight and efficient for this stack.
-
Secrets vs. Environment Variables: Environment variables are used for non-sensitive configuration (like database names), while Docker Secrets are utilized to securely handle passwords (stored in /secrets/) to ensure no sensitive data is leaked in the Git repository.
-
Docker Network vs. Host Network: This project uses a custom bridge network (inception) instead of the host network to provide isolation and service discovery by container name, which is more secure.
-
Docker Volumes vs. Bind Mounts: Local volumes with bind options are configured to persist data in /home/nrasamim/data/, ensuring that database and website files survive container restarts and deletions.
-
A Virtual Machine (Debian recommended).
-
Docker and Docker Compose installed.
-
Your domain login.42.fr mapped to your local IP_address in your /etc/hosts file.
Clone the repository and navigate to the root directory.
git clone https://github.com/Harilala42/Inception.git
cd Inception
Ensure your .env file and secrets/ directory are properly configured:
.env
# Site Info
TITLE=Inception
DOMAIN_NAME=login.42.fr
# Database Info
MYSQL_USER=login
MYSQL_DATABASE=wordpress_db
# Mandatory User 1: The Administrator
WP_ADMIN_USER=login
WP_ADMIN_EMAIL=email
# Mandatory User 2: The Author
WP_USER=login
WP_USER_EMAIL=email
Project Structure
.
├── DEV_DOC.md
├── Makefile
├── README.md
├── secrets
│ ├── crediantials
│ │ ├── wp_admin_password.txt # PASSWORD FOR WORDPRESS ADMIN
│ │ └── wp_user_password.txt # PASSWORD FOR WORDPRESS USER
│ ├── db_password.txt # PASSWORD FOR DB USER
│ └── db_root_password.txt # PASSWORD FOR DB ADMIN
├── srcs
│ ├── docker-compose.yml
│ └── requirements
│ ├── mariadb
│ │ ├── conf
│ │ │ └── configure.sh
│ │ └── Dockerfile
│ ├── nginx
│ │ ├── conf
│ │ │ └── nginx.conf
│ │ └── Dockerfile
│ └── wordpress
│ ├── conf
│ │ ├── configure.sh
│ │ └── www.conf
│ └── Dockerfile
└── USER_DOC.md
Run the following command to build and start the infrastructure:
make up
This command creates the necessary local directories and builds the images using the docker-compose.yml file.
To stop the services:
make down
To remove all containers, networks, and images:
make clean
To perform a full reset (including volumes and data):
make fclean.
-
Docker Official Documentation: Docker Documentation served as the primary reference for writing Dockerfiles and the Compose configuration.
-
NGINX Guide: Used for configuring TLSv1.2/1.3 protocols.
-
Gemini AI: Used for writing documentation and as digital assistant.