Skip to content
daniel-ploetzlPublic

About

Building a small Docker-based infrastructure with NGINX, WordPress and MariaDB

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project has been created as part of the 42 curriculum by dplotzl.

Inception

Description

This project builds a small Docker-based infrastructure with three mandatory services: NGINX (TLS), WordPress (php-fpm), and MariaDB. The goal is to understand service isolation, networking, persistence, and secure configuration in a reproducible setup.

Docker in this project

  • srcs/docker-compose.yml orchestrates all services.
  • Each service is built from a dedicated Dockerfile under srcs/requirements/.
  • Persistent data is stored in host paths under /home/dplotzl/data/.

Main design choices

  • NGINX is the only public entrypoint on port 443.
  • WordPress and MariaDB are only reachable on the internal Docker network.
  • Secrets are mounted via Docker secrets files instead of hardcoded credentials.
  • Data persists through Docker volumes mapped to the required host directory.

Comparison required by the subject

Virtual Machines vs Docker

  • VM: full guest OS, heavier resources, stronger machine-level isolation.
  • Docker: shared host kernel, lighter, faster startup, easier service composition.

Secrets vs Environment Variables

  • Env vars are convenient for non-sensitive configuration.
  • Secrets are better for passwords/credentials because they are mounted as files and avoid plaintext values in command history and image layers.

Docker Network vs Host Network

  • Docker bridge network isolates services and supports controlled inter-container DNS.
  • Host network removes that isolation and is forbidden for this project.

Docker Volumes vs Bind Mounts

  • Docker volumes are Docker-managed and portable between runs.
  • Bind mounts map specific host paths directly and are less portable.
  • This project uses named volumes with bind-backed storage at /home/dplotzl/data/ to satisfy subject constraints.

Instructions

  1. Create secrets in secrets/:
    • db_root_password.txt
    • db_password.txt
    • wp_admin_password.txt
    • wp_user_password.txt
  2. Configure srcs/.env (domain and usernames).
  3. Start:
    • make up
  4. Stop:
    • make down
  5. Clean containers/volumes:
    • make clean
  6. Full cleanup:
    • make fclean

Resources

AI usage

AI was used for:

  • reviewing shell scripts and configuration adjustments
  • drafting documentation structure and formatting
  • suggesting best practices for Docker security

All generated content was manually reviewed, tested and adapted before integration.

About

Building a small Docker-based infrastructure with NGINX, WordPress and MariaDB

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages