Skip to content

A project that aims to broaden your knowledge of system administration by using Docker. Virtualize several Docker images, creating them in a new personal virtual machine.

Notifications You must be signed in to change notification settings

amine-za/Inception-1337

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Inception - Dockerized Microservices Architecture

Linux Docker Docker Compose Nginx MariaDB WordPress

Inception is a system administration project that deploys a fully functional LEMP stack (Linux, Nginx, MariaDB, PHP-FPM) using Docker containers. The architecture emphasizes security, modularity, and data persistence through strict volume management and custom Docker networks.

System Architecture & Deployment

Architecture Diagram Docker Containers Status Secure HTTPS Connection

Technical Architecture

This project does not use pre-made images. All containers are built from Alpine Linux (for minimal footprint) using custom Dockerfiles.

  1. Nginx (Reverse Proxy):

    • Configured as the only entry point (Port 443).
    • Handles TLS/SSL encryption (self-signed) to ensure secure communication.
    • Forwards PHP requests to the WordPress container via FastCGI.
  2. MariaDB (Database):

    • Isolated in a private subnet (not exposed to the host).
    • Persistent storage via Docker Volumes ensures data survives container restarts.
  3. WordPress + PHP-FPM:

    • Serves dynamic content.
    • Communicates with MariaDB over a dedicated internal Docker network.

Deployment Instructions

Prerequisites

Docker & Docker Compose
Make (for automation)
  1. Clone the repository

    git clone <your-repo-url>
    cd inception
  2. Create a .env file in the project root with your settings. Example:

    DOMAIN_NAME=yourdomain.com
    DB_NAME=wordpress
    DB_USER=wpuser
    DB_PASS=yourpassword
    ROOT_PASS=adminpassword
    EMAIL_ROOT=admin@example.com
    EMAIL=editor@example.com
    URL=https://yourdomain.com
    TITLE=MyWordPressSite
  3. Start everything with one command:

    make up

    This will automatically create the needed data directories and build/start all containers.

  4. Access your site:

    The project is configured to work with both the domain specified in your .env file and localhost for easier testing. You can access your site using either:

    • Option 1: Using localhost (Recommended for quick testing)

      https://localhost
      

      This works immediately without any additional configuration - perfect for testing after cloning the repository!

    • Option 2: Using your configured domain

      https://yourdomain.com  (or whatever you set in DOMAIN_NAME)
      

      To use this option, you'll need to add your domain to your hosts file:

      • Linux/macOS: Add 127.0.0.1 yourdomain.com to /etc/hosts
      • Windows: Add 127.0.0.1 yourdomain.com to C:\Windows\System32\drivers\etc\hosts (requires admin privileges)
      • WSL: Add 127.0.0.1 yourdomain.com to /etc/hosts in your WSL distribution

    Why both options? The project includes dynamic URL detection that automatically adapts WordPress URLs based on how you access the site. This allows anyone who clones the repository to test immediately using localhost without needing to modify system hosts files, while still supporting the configured domain for production-like testing.

Stopping and Cleaning Up

  • To stop the containers:
    make down
  • To remove all containers, images, and data:
    make fclean

Notes

  • The Nginx server uses a self-signed SSL certificate. Your browser may show a warning - this is normal for local development.
  • Data is stored in your home directory under ~/data/wordpress and ~/data/mariadb.
  • You can change settings by editing the .env file and running make re.
  • Dynamic URL Support: The project automatically detects whether you're accessing via localhost or your configured domain and generates WordPress URLs accordingly. This means CSS, JavaScript, and other assets will load correctly regardless of which URL you use.

Project Files

  • docker-compose.yml: Defines the services and how they connect.
  • requirements/: Contains Dockerfiles and configuration for each service.
  • Makefile: Automates all setup and management commands.

Troubleshooting

  • Make sure Docker and Docker Compose are installed and running.
  • Check the logs with docker compose logs if something does not work.
  • Ensure your .env file is correct and all needed variables are set.

This project is for educational purposes and is a good starting point for learning about Docker, Nginx, MariaDB, and WordPress integration.

About

A project that aims to broaden your knowledge of system administration by using Docker. Virtualize several Docker images, creating them in a new personal virtual machine.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published