Skip to content

Latest commit

 

History

History
234 lines (148 loc) · 3.06 KB

DEV_DOC.md

File metadata and controls

234 lines (148 loc) · 3.06 KB

Developer Documentation

Overview

This document explains how to set up, build, run, and manage the Inception project from a developer perspective. It also describes how data is stored and persists across container restarts.


Prerequisites

Before starting, make sure you have:

  • Docker installed and running
  • Docker Compose installed
  • Make installed

Check installation:

docker --version
docker compose version
make --version

Project Setup

1. Clone the repository

git clone <your_repository_url>
cd Inception

2. Configure environment variables

Edit the file:

srcs/.env

This file contains:

  • Database name
  • WordPress configuration
  • Domain name
  • FTP username

3. Configure secrets

Secrets are stored in:

secrets/

Files include:

  • db_password.txt
  • db_root_password.txt
  • wp_admin_password.txt
  • wp_user_password.txt
  • ftp_password.txt

These are used by Docker Compose and should not be committed to version control.


Build and Launch

Build and start all services

make

This will:

  • Build Docker images
  • Start containers
  • Create networks and volumes

Stop services

make down

Rebuild from scratch

make re

Container Management

List running containers

docker ps

Access a container

docker exec -it <container_name> bash

Example:

docker exec -it wordpress bash

View logs

docker logs <container_name>

Restart a container

docker restart <container_name>

Volume and Data Persistence

Where data is stored

The project uses Docker volumes with bind mounts:

  • MariaDB data:
/home/mgarouj/data/mariadb
  • WordPress data:
/home/mgarouj/data/wordpress

How persistence works

  • Data is stored on the host machine
  • Containers can be stopped or removed without losing data
  • When containers restart, they reuse existing data

Check volumes

docker volume ls

Inspect a volume

docker volume inspect <volume_name>

Networking

  • All containers are connected through a custom Docker bridge network
  • Services communicate using container names (e.g., mariadb, wordpress, redis)
  • External access is only exposed through defined ports (443, 8080, 8081, 8082)

Notes

  • Do not store sensitive data inside Docker images
  • Always use .dockerignore to exclude .env and secrets
  • Use Docker secrets for passwords
  • Ensure correct permissions for mounted volumes

Troubleshooting

Containers not starting

docker logs <container_name>

Port already in use

Check and stop conflicting services:

sudo lsof -i :443

Reset everything

make fclean
make