The Inception project is part of the 42 School curriculum, focusing on DevOps practices. The goal is to build a multi-service application using Docker containers orchestrated with Docker Compose. The project introduces essential concepts of containerization, networking, and persistent storage.
The project uses Docker Compose version 3.9 for defining the multi-service architecture.
A custom Docker network named inception (driver: bridge) is configured to allow communication between the services.
The project defines the following services in the docker-compose.yml file:
-
Nginx
- Acts as the web server.
- Routes traffic to the WordPress service.
- Ports: exposes port
443for secure HTTPS communication. - Volumes: mounts the WordPress files to
/var/www/wordpress.
-
MariaDB
- Provides the database backend for WordPress.
- Volumes: stores database files in a persistent directory.
-
WordPress
- Hosts the WordPress application.
- Relies on the MariaDB service for database operations.
- Volumes: mounts WordPress files for persistence.
The project uses Docker volumes for persistent data storage:
wordpress:- Maps to
/home/$(USER)/data/wpon the host. - Stores WordPress application files.
- Maps to
mariadb:- Maps to
/home/$(USER)/data/dbon the host. - Stores MariaDB database files.
- Maps to
The provided Makefile simplifies managing the Docker setup. Below are the targets:
Builds and launches all services:
make allBuilds the Docker images for all services:
make buildStarts the services in detached mode after ensuring volumes are created:
make upStops and removes all running containers:
make downRuns a custom script to remove temporary files:
make cleanPerforms a complete cleanup of Docker resources:
make prune-
Docker Containers
- Implements a containerized architecture for better modularity and scalability.
-
Custom Docker Network
- Ensures seamless communication between services.
-
Persistent Storage
- Prevents data loss with host-mounted Docker volumes.
-
Automation with Makefile
- Simplifies building, starting, and cleaning up the project.
This project is a part of the 42 School curriculum, designed to provide hands-on experience with Docker, container orchestration, and DevOps practices.