Inception
42 Abu Dhabi

Inception

Docker Infrastructure Setup

4 weeks
Individual Project
DockerNGINXWordPressMariaDBDocker Compose

A comprehensive system administration project using Docker to create a complete infrastructure with multiple services including NGINX, WordPress, and MariaDB.

Key Features

Multi-Container Setup

Orchestrated multiple Docker containers with proper networking, volumes, and service dependencies.

NGINX Configuration

Configured NGINX as reverse proxy with SSL/TLS encryption and load balancing capabilities.

WordPress Deployment

Set up WordPress with PHP-FPM, custom themes, and proper database connectivity.

Database Management

Configured MariaDB with persistent volumes, user management, and backup strategies.

Development Journey

Phase 1

Docker Environment Setup

Established Docker development environment, created Dockerfiles for each service, and configured base images with security best practices.

Phase 2

Service Configuration

Configured individual services including NGINX web server, MariaDB database, and WordPress application with proper environment variables.

Phase 3

Network & Volume Setup

Implemented Docker networking for service communication, configured persistent volumes for data storage, and established service dependencies.

Phase 4

SSL & Production Ready

Added SSL/TLS certificates, implemented security hardening, and finalized Docker Compose orchestration for production deployment.

Challenges & Solutions

Container Networking

Problem:

Setting up proper network communication between containers while maintaining security and isolation.

Solution:

Implemented Docker networks with proper isolation and service discovery mechanisms.

Data Persistence

Problem:

Ensuring data persistence across container restarts and maintaining data integrity for database operations.

Solution:

Configured Docker volumes and implemented proper backup and restore procedures.

SSL Configuration

Problem:

Implementing SSL/TLS certificates and HTTPS configuration within containerized NGINX environment.

Solution:

Generated self-signed certificates and configured NGINX with proper SSL settings and security headers.

docker-compose.yml
yaml
version: '3.8'

services:
  nginx:
    build: 
      context: ./requirements/nginx
      dockerfile: Dockerfile
    container_name: nginx
    depends_on:
      - wordpress
    ports:
      - "443:443"
    volumes:
      - wp-volume:/var/www/
    networks:
      - inception
    restart: on-failure

  mariadb:
    build:
      context: ./requirements/mariadb
      dockerfile: Dockerfile
    container_name: mariadb
    ports:
      - "3306:3306"
    volumes:
      - db-volume:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASS}
      - MYSQL_USER=${DB_USER}
      - MYSQL_PASSWORD=${DB_PASS}
      - MYSQL_DATABASE=${DB_NAME}
    networks:
      - inception
    restart: on-failure

volumes:
  wp-volume:
    driver_opts:
      o: bind
      type: none
      device: /home/user/data/wordpress
  db-volume:
    driver_opts:
      o: bind
      type: none
      device: /home/user/data/mariadb

networks:
  inception:
    driver: bridge