https://github.com/magalhaesm/inception
A 42 School project that implements a containerized application infrastructure using Docker. Includes NGINX with TLS, WordPress+PHP-FPM, MariaDB, plus bonus services like Redis, FTP, Adminer, and a static Go website.
https://github.com/magalhaesm/inception
42-school 42sp adminer cadvisor containerization devops docker docker-compose ftp-server go-web infrastructure mariadb nginx php-fpm redis-cache system-administration tls wordpress
Last synced: 6 months ago
JSON representation
A 42 School project that implements a containerized application infrastructure using Docker. Includes NGINX with TLS, WordPress+PHP-FPM, MariaDB, plus bonus services like Redis, FTP, Adminer, and a static Go website.
- Host: GitHub
- URL: https://github.com/magalhaesm/inception
- Owner: magalhaesm
- License: mit
- Created: 2023-12-04T14:06:10.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-31T23:34:03.000Z (7 months ago)
- Last Synced: 2025-04-13T11:15:16.439Z (6 months ago)
- Topics: 42-school, 42sp, adminer, cadvisor, containerization, devops, docker, docker-compose, ftp-server, go-web, infrastructure, mariadb, nginx, php-fpm, redis-cache, system-administration, tls, wordpress
- Language: HTML
- Homepage:
- Size: 39.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Inception
> A Docker infrastructure project for 42 School## π Language / Idioma
[π§π· Ver em PortuguΓͺs](README_pt-br.md)## π About the Project
This project is part of the 42 School curriculum and aims to broaden knowledge of system administration using Docker. The goal is to virtualize several Docker images in a personal virtual machine, setting up a small infrastructure composed of different services under specific rules.
The infrastructure implements the following requirements:
- Docker containers for:
- **NGINX** with TLSv1.2/TLSv1.3
- **WordPress + php-fpm**
- **MariaDB**
- Volumes for:
- WordPress database
- WordPress website files
- A Docker network to establish connection between containers## ποΈ Architecture
```
βββββββββββ
β WWW β
ββββββ¬βββββ
β
port 443
β
βΌ
ββββββββββββββββββDocker Networkβββββββββββββββββββ
β β
β βββββββββββ βββββββββββ ββββββββββ β
β β NGINX βββ9000ββWordPressββ3306ββMariaDB β β
β βββββββββββ β +PHP β ββββββ¬ββββ β
β β ββββββ¬βββββ β β
β β β β β
β β β β β
β βΌ βΌ βΌ β
β βββββββββββββββββββVolumesββββββββββββββββββββ β
β β β β
β β βββββββββββββ βββββββββββββ β β
β β βWordPress β βDatabase β β β
β β β Files β β β β β
β β βββββββββββββ βββββββββββββ β β
β β β β
β ββββββββββββββββββββββββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
```## π Bonus Features
In addition to the main requirements, the project includes the following bonus features:
- **Redis Cache**: To improve WordPress performance
- **FTP Server**: Pointing to the WordPress volume
- **Static Website**: Developed in Go (not in PHP)
- **Adminer**: Database management interface
- **cAdvisor**: Container resource monitoring**Architecture with Bonus Features:**
```mermaid
%%{ init: { 'graph': { 'curve': 'monotoneX' } } }%%
graph TD
Web(((WWW)))
subgraph HOST
subgraph Docker Network
C1(MariaDB)
C2(WordPress+PHP)
C3(NGINX)
C4(FTP)
C5(Adminer)
C6(Website)
C7(Cadvisor)
C8(Redis)
end
subgraph Filesystem
DB[(Database)]
WP[(WordPress)]
end
endWeb -. 21 .- C4
Web -. 443 .- C3
C3 -. 9000 .- C2
C3 -. 8080 .- C6
C3 -. 8080 .- C7
C3 -. 8081 .- C5
C2 -. 3306 .- C1
C2 -. 6379 .- C8
C1 --> DB
C2 & C4 --> WPstyle Web fill:#4F81BD,stroke:#1B4F72,stroke-width:2px
```## π Technologies Used
- **Docker and Docker Compose**: Container virtualization and orchestration
- **Alpine/Debian**: Base images for containers
- **NGINX**: Web server with HTTPS support
- **MariaDB**: Database management system
- **WordPress and PHP-FPM**: CMS and PHP processor
- **Redis**: In-memory cache system
- **Go**: Language for the static website
- **VSFTPD**: FTP server
- **Adminer**: Web-based database manager
- **cAdvisor**: Container resource monitoring## π§ How to Use
### Requirements
- Linux or macOS
- Docker and Docker Compose installed
- Sudo permissions### Setup
1. Clone the repository:
```bash
git clone https://github.com/magalhaesm/inception.git
cd inception
```2. Configure the environment file:
```bash
cp srcs/.env.example srcs/.env
# Edit the .env file as needed
```3. Add an entry to your `/etc/hosts` file:
```
127.0.0.1 your-login.42.fr website.your-login.42.fr cadvisor.your-login.42.fr
```### Commands
The Makefile provides several useful commands:
```bash
# Start all services
make up# Stop all services
make down# Start existing services
make start# Stop services without removing them
make stop# Access a container's shell
make shell# Check container status
make ps# View container logs
make logs# Remove all containers and images
make clean# Remove containers, images, and volumes
make fclean# Clean up the entire Docker environment (including volumes)
make prune
```## π¦ Project Structure
```
inception/
βββ Makefile # Scripts to manage the project
βββ srcs/
β βββ .env # Environment variables
β βββ docker-compose.yml
β βββ requirements/
β βββ mariadb/
β β βββ conf/
β β βββ Dockerfile
β β βββ tools/
β βββ nginx/
β β βββ conf/
β β βββ Dockerfile
β βββ wordpress/
β β βββ Dockerfile
β β βββ tools/
β βββ bonus/
β βββ adminer/
β βββ cadvisor/
β βββ ftp/
β βββ redis/
β βββ website/
```## π Security
- NGINX configured with TLSv1.2 and TLSv1.3 only
- Environment variables for passwords and sensitive data
- Secure communication between containers via Docker network## π Notes
- Containers restart automatically in case of failure
- Infrastructure access is exclusively through HTTPS (port 443)
- Passwords and credentials are configured through environment variables## π License
This project is under the MIT License. See the [LICENSE](LICENSE) file for more details.