Developer Documentation (DEV_DOC)
1. Environment Setup
Prerequisites
- Linux OS (Debian/Ubuntu/Alpine)
- Docker & Docker Compose Plugin
- Make
- Git
Configuration
- Clone Repo:
git clone ... - Environment Variables: Copy
srcs/.env.example(if exists) or createsrcs/.env. Required variables includeDOMAIN_NAME,MYSQL_ROOT_PASSWORD,MYSQL_USER,MYSQL_PASSWORD,WP_ADMIN_PASSWORD, etc. - Data Directories: The Makefile automatically creates data directories at:
/home/${USER}/data/wordpress/home/${USER}/data/mariadb
2. Build and Launch
The project uses a Makefile to simplify Docker Compose commands.
Build & Run:
bashmake all # or just 'make'This runs
docker compose -f srcs/docker-compose.yml up -d --build.Rebuild specific service:
bashdocker compose -f srcs/docker-compose.yml up -d --build <service_name>Example:
docker compose ... --build nginx
3. Container Management
- List Containers:
docker ps - View Logs:bash
docker logs <container_name> # Follow logs docker logs -f nginx - Enter Container Shell:bash
docker exec -it <container_name> /bin/bash # For Alpine containers (website) use /bin/sh docker exec -it website /bin/sh
4. Data Persistence
Data is persisted using Docker Bind Mounts to the host machine. This ensures data survives container removal (make down).
Database:
- Container Path:
/var/lib/mysql - Host Path:
/home/${USER}/data/mariadb
- Container Path:
WordPress Files:
- Container Path:
/var/www/html - Host Path:
/home/${USER}/data/wordpress
- Container Path:
To completely reset data (Simulate fresh install):
bash
make fcleanWarning: This deletes the data directories /home/${USER}/data/*.