Skip to content
Welf42Public

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

33 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Note: secrets/ is gitignored and not included in this repo. Create it locally before running the stack (see Setup).

Inception — 42 School Project

A multi-container Docker infrastructure deploying a WordPress site with NGINX, MariaDB, and Adminer — all orchestrated with Docker Compose.

Overview

This project sets up a complete web stack inside a virtual machine using only custom-built Docker images (no pre-built images from Docker Hub for core services). Each service runs in its own container and communicates over a dedicated Docker network.

Architecture

Browser (HTTPS)
     │
     ▼
[ NGINX ] ──── TLSv1.2 / TLSv1.3 only ──── port 443
     │
     ▼
[ WordPress + php-fpm ]
     │
     ▼
[ MariaDB ]          [ Adminer ] ──── port 8080

         Shared Docker network: inception
Service Role
NGINX Reverse proxy, TLS termination (1.2 / 1.3)
WordPress CMS running with php-fpm (no NGINX inside)
MariaDB Relational database for WordPress
Adminer (Bonus) Web-based database management UI

Key Features

  • All core images built from scratch using custom Dockerfiles (Alpine-based)
  • TLS-only access via NGINX — HTTP is not exposed
  • Docker secrets for sensitive credentials (DB passwords, WP admin password)
  • Named volumes with host bind mounts for persistent data
  • restart: always policy on all containers
  • Single make run command to build and start the full stack

Project Structure

inception/
├── Makefile
├── srcs/
│   ├── docker-compose.yml
│   ├── .env
│   └── requirements/
│       ├── nginx/
│       ├── wordpress/
│       └── mariadb/
│   └── bonus/
│       └── adminer/
└── secrets/
    ├── certs/
    ├── db_password.txt
    ├── db_root_password.txt
    └── wp_admin_password.txt

Usage

Prerequisites

  • Docker and Docker Compose installed
  • Certificates generated and placed in secrets/certs/
  • Host entry added for wlucke.42.fr

Setup (first time)

# Create the secrets directory and password files
mkdir -p secrets/certs
echo "your_db_password"      > secrets/db_password.txt
echo "your_db_root_password" > secrets/db_root_password.txt
echo "your_wp_admin_password" > secrets/wp_admin_password.txt

# Generate self-signed TLS certificate
make certs

# Create data directories and set permissions
make dirs

# Add hostname to /etc/hosts
make hosts

Run

# Build images and start all containers
make run

# Or step by step:
make build
make up

Other Commands

make down       # Stop and remove containers
make restart    # Restart all services
make logs       # Tail logs from all containers
make clean      # Stop containers and remove volumes
make re         # Full rebuild from scratch
make adminer    # Start the Adminer bonus container

Remote Access (VM workflow)

make send       # rsync project to VM over SSH
make ssh        # SSH into VM
make firefox    # Open Firefox on VM via X forwarding

Bonus Service: Adminer

Adminer is a lightweight, single-file database management tool. It runs in its own container on port 8080 and connects to the MariaDB container over the inception network.

make adminer          # Start Adminer
make adminer_clean    # Stop and remove Adminer container

Volumes

Volume Mount path on host
wordpress_data /home/<user>/data/wordpress
mariadb_data /home/<user>/data/mariadb

Security

  • Secrets passed to containers via Docker secrets (files), not environment variables
  • TLS certificates stored in secrets/certs/ and mounted read-only into NGINX
  • NGINX configured to accept TLSv1.2 and TLSv1.3 only

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages