This project has been created as part of the 42 curriculum by aech-chi.
This project, "Inception," aims to broaden knowledge of system administration by using Docker. It involves setting up a complete infrastructure composed of different services (NGINX, WordPress, MariaDB) under specific rules using Docker Compose.
Each service runs in a dedicated container, built from Alpine or Debian, ensuring a modular and secure architecture.
- Prerequisites: Ensure
dockeranddocker-composeare installed. - Setup Domain: Add
127.0.0.1 aech-chi.42.frto your/etc/hostsfile. - Data Folders: Ensure
/home/aech-chi/data/wordpressand/home/aech-chi/data/mariadbexist. - Secrets: Populate the files in
secrets/with your passwords. - Launch: Run
makeat the root of the directory. - Access: Open
https://aech-chi.42.frin your browser.
- Virtual Machines (VMs): Virtualize the hardware. Each VM has a full OS kernel, making them heavy and slow to start. They provide strong isolation but consume significant resources.
- Docker: Virtualizes the OS. Containers share the host's kernel but isolate processes. They are lightweight, start instantly, and are ideal for microservices.
- Environment Variables: Stored in plain text in the system environment. Can be seen via
docker inspectorprintenv. Less secure for sensitive data. - Docker Secrets: Manage sensitive data (passwords, keys). The data is mounted as a file inside the container only when needed and is not exposed in the environment variables. This is the recommended secure method.
- Host Network: The container shares the host's IP and port space. No isolation.
- Docker Network: Creates an isolated virtual network (bridge). Containers can talk to each other by name (DNS) without exposing ports to the outside world, increasing security.
- Docker Volumes: Managed by Docker in a specific storage area. Harder to access directly from the host but easier to back up.
- Bind Mounts: A specific file or directory on the host machine is mounted into a container. We use this to store data in
/home/aech-chi/dataso it persists and is accessible by the host user.
The following documentation was used to configure the services and orchestration:
-
Docker Engine & Compose:
-
NGINX:
-
WordPress & CLI:
- WP-CLI Command Reference
- WordPress Docker Official Images (Used for reference on volume paths)
-
MariaDB: