Welcome to the Inception Project repository, part of the curriculum at École 42. This project focuses on containerization and orchestration, leveraging tools like Docker and Docker Compose to deploy a robust multi-service architecture.
The goal of this project is to explore the principles of containerization by creating and managing a multi-service environment. You will deploy services in isolated containers, ensuring they interact seamlessly and meet the requirements of modern development and deployment practices.
By the end of the project, you will have a deeper understanding of:
- Docker and containerization.
- Networking between containers.
- Configuring services like NGINX, MariaDB, and WordPress.
- Persisting data and managing volumes.
- Ensuring security and proper resource allocation.
- Set up a multi-container architecture using Docker and Docker Compose.
- Create and configure services such as:
- NGINX: as a reverse proxy.
- MariaDB: for database management.
- WordPress: as a content management system.
- Use volumes to ensure data persistence.
- Isolate services to guarantee secure communication.
- Implement best practices for Dockerfile and Compose configurations.
To successfully complete this project, your environment must meet the following requirements:
- Docker: Version 20.10 or higher.
- Docker Compose: Version 1.29 or higher.
- A virtual machine with Debian 11 or a similar Linux distribution.
- Clone this repository to your local machine:
git clone https://github.com/yourusername/inception-project.git
- Build the Docker containers using Docker Compose:
docker-compose up --build- Access the services:
- NGINX: http://localhost
- WordPress: http://localhost (use the credentials provided in your .env file).
- MariaDB: Accessible through a database client (host: mariadb, port: 3306).
Below is an overview of the project directory structure:
inception-project/
├── srcs/
│ ├── requirements/
│ │ ├── nginx/ # Configuration files for NGINX
│ │ ├── wordpress/ # WordPress setup and customization
│ │ └── mariadb/ # MariaDB database setup
│ └── docker-compose.yml # Main Compose file
├── Makefile # Makefile for building and managing containers
├── .env # Environment variables
└── README.md # Project documentationCreate a .env file at the root of the project to manage sensitive information such as database credentials. Example:
DB_NAME=wordpress
DB_USER=wp_user
DB_PASSWORD=securepassword
DB_ROOT_PASSWORD=rootpassword- Installs the required folders and starts the Docker containers in build mode, monitoring changes.
- Displays the status of the containers afterward.
- Creates the folders needed for persistent volumes:
/Users/${USER}/data/wwwfor WordPress files./Users/${USER}/data/databasefor MariaDB data.
- Copies the
.envfile to thesrcsdirectory.
- Displays the current status of all containers (running or stopped).
- Shows the real-time logs of the containers.
- Opens a bash session inside the NGINX container.
- Opens a bash session inside the MariaDB container.
- Opens a bash session inside the WordPress container.
- Stops all Docker containers and removes the following volumes:
inception_wwwinception_database
- Cleans up unused system files with
docker system prune. - Removes the
.envfile from thesrcsdirectory.
- Performs the same steps as
fclean. - Additionally, deletes the
/Users/${USER}/datafolder.
- Fully resets the project by running
fcleanfollowed byall.
- Reverse Proxy: Secure and efficient routing using NGINX.
- Database Management: A robust MariaDB setup for WordPress data.
- CMS Deployment: Fully operational WordPress site with persistent storage.