This technical documentation provides engineers and evaluators with in-depth instructions regarding environment setup, build pipelines, directory structures, Docker Compose mechanics, and persistence mechanics.
The Inception project requires a Linux environment (Debian Bookworm or Ubuntu 24.04 LTS).
- Docker Engine:
>= 24.0.0 - Docker Compose (v2 plugin or standalone):
>= 2.20.0 - GNU Make:
>= 4.3 - Root / Sudo privileges: Required for bind-mount host directory management (
/home/${USER}/data) and updating/etc/hosts.
Map the project domain to localhost by editing /etc/hosts:
echo "127.0.0.1 rhiguita.42.fr" | sudo tee -a /etc/hostsCreate srcs/.env based on the provided template:
cp srcs/.env.example srcs/.envEnsure INCEPTION_USER matches your local Linux username so that data directories align:
INCEPTION_USER=rhiguita
DOMAIN_NAME=rhiguita.42.fr
MYSQL_DATABASE=wordpress
MYSQL_USER=wp_user
WP_TITLE=Inception 42 Madrid
WP_ADMIN_USER=rhiguita_master
WP_ADMIN_EMAIL=rhiguita@student.42madrid.com
WP_USER=student
WP_EMAIL=student@student.42madrid.comCreate the plain text files inside secrets/ (permissions 600 or 644):
mkdir -p secrets
echo "SuperSecretPass123!" > secrets/db_password.txt
echo "RootSuperAdminPass456!" > secrets/db_root_password.txt
echo "WpMasterPass789!" > secrets/wp_admin_password.txtAll operations are abstracted via the root Makefile:
| Target | Description | Executed Command |
|---|---|---|
all / up |
Creates host storage directories, builds images from source, and starts containers | docker-compose -f srcs/docker-compose.yml up -d --build |
down |
Stops containers and removes the bridge network, leaving volumes intact | docker-compose -f srcs/docker-compose.yml down |
start |
Starts previously stopped containers without re-building | docker-compose -f srcs/docker-compose.yml start |
stop |
Pauses running containers | docker-compose -f srcs/docker-compose.yml stop |
status |
Lists running containers, exit codes, and health checks | docker-compose -f srcs/docker-compose.yml ps |
logs |
Streams live logs across all services | docker-compose -f srcs/docker-compose.yml logs -f |
clean |
Alias for down |
docker-compose -f srcs/docker-compose.yml down |
fclean |
Destroys containers, images, volumes, and purges /home/$(USER)/data |
docker-compose down -v --rmi all && sudo rm -rf /home/$(USER)/data |
re |
Executes fclean followed by all (fresh build from scratch) |
make fclean && make all |
If debugging without the Makefile, you can invoke docker-compose directly pointing to the configuration file:
# Build and run containers
docker-compose -f srcs/docker-compose.yml up -d --build
# Inspect running services
docker-compose -f srcs/docker-compose.yml ps
# Tail logs for a specific service (e.g. MariaDB)
docker-compose -f srcs/docker-compose.yml logs -f mariadb
# Execute an interactive shell inside a container
docker-compose -f srcs/docker-compose.yml exec wordpress bash
docker-compose -f srcs/docker-compose.yml exec mariadb bash
docker-compose -f srcs/docker-compose.yml exec nginx bash
# Access database directly inside MariaDB container
docker-compose -f srcs/docker-compose.yml exec mariadb mariadb -u root -p"$(cat secrets/db_root_password.txt)"Services communicate via an isolated user-defined bridge network inception_network. No service uses network_mode: host or legacy --link.
mariadb: Accessible only atmariadb:3306insideinception_network.wordpress: Accessible only atwordpress:9000(FastCGI) insideinception_network.nginx: Only service exposing ports (443:443) to the host.
To inspect network topology:
docker network ls
docker network inspect srcs_inception_networkThe project requires persistent storage on the host machine under /home/<login>/data. To comply with 42 evaluation rules while retaining Docker volume management capabilities, named volumes are configured using the local bind driver:
volumes:
mariadb_data:
driver: local
driver_opts:
type: none
o: bind
device: /home/${INCEPTION_USER}/data/mariadb
wordpress_data:
driver: local
driver_opts:
type: none
o: bind
device: /home/${INCEPTION_USER}/data/wordpress-
List Volumes:
docker volume ls
-
Inspect Volume Path:
docker volume inspect srcs_mariadb_data docker volume inspect srcs_wordpress_data
Verify that the
Mountpointanddevicefields contain/home/<login>/data/. -
Reboot Persistence Test:
- Create content in WordPress or execute an SQL query inserting a record.
- Restart the virtual machine or execute:
make down make up
- Verify that all database entries and uploads in
/home/${INCEPTION_USER}/data/persist without data loss.
During the evaluation, the evaluator will ask you to change a service configuration (e.g., port modification):
- Edit
srcs/requirements/nginx/conf/nginx.conf:listen 8443 ssl; listen [::]:8443 ssl;
- Edit
srcs/docker-compose.ymlundernginx:ports: - "8443:8443"
- Rebuild and restart:
make up
- Verify accessibility on the new port:
curl -k -I https://rhiguita.42.fr:8443