Prerequisites: Ensure the following are installed on your host system:
- Docker
- Docker Compose
- make
Project Configuration:
- Create a
.envfile at the root of the repository. - Fill in the required environment variables, e.g.:
MYSQL_ROOT_PASSWORDMYSQL_USERMYSQL_PASSWORDWORDPRESS_DB_PASSWORD
- Map the local IP to your test domain in
/etc/hosts, e.g.: 127.0.0.1 kikwasni.42.fr
The project uses a Makefile to simplify Docker Compose commands:
| Command | Description |
|---|---|
make create |
Initializes host directories for data binding and sets up /etc/hosts entry. |
make build |
Builds Docker images from each service’s Dockerfile. |
make up |
Runs setup, build, and starts the containers in detached mode (docker compose up -d). |
| Command | Description |
|---|---|
make down |
Safely stops all running containers. |
make clean |
Stops containers, prunes unused volumes, deletes local data folders. |
make fclean |
Extends clean by fully clearing Docker system cache. |
make re |
Full project reset (fclean + up). |
docker compose logs -f |
Follow container logs in real time. |
- WordPress Files: volume
wp_data, mapped to/home/<kikwasni>/data/wp. - Database Content: volume
db_data, mapped to/home/<kikwasni>/data/db. - Both volumes must be named and configured via
driver_optsto persist data across rebuilds.