This project has been created as part of the 42 curriculum by madelvin
This guide explains how a developer can set up, run, and manage the project.
This project uses Docker to run a set of web services, including:
- NGINX: Web server.
- WordPress: Content Management System (CMS).
- MariaDB: Database.
- Redis: Cache for performance.
- FTP: Server for file transfers.
- Adminer: Web-based database management tool.
- Static Site: A simple static website.
- Portainer: An interface to manage Docker.
Before you start, install:
- Docker
- Docker Compose
- make
git clone <repository-url>
cd winceptionThe project uses a .env file for passwords and configurations. This file is ignored by Git, so you must create it yourself.
- Go to the
srcsdirectory:cd srcs - Copy the example configuration file to a new
.envfile:cp .env.example .env
- Open the new
.envfile and customize the variables (e.g.,DOMAIN_NAME,MYSQL_ROOT_PASSWORD, etc.) with your own secure values.
Important: Do not commit the .env file to Git.
To access services using the domain name, you need to edit your /etc/hosts file.
- Open the file with admin rights:
sudo nano /etc/hosts
- Add these lines (replace
DOMAIN_NAMEfrom your domain name in your.envfile):127.0.0.1 DOMAIN_NAME.42.fr
The Makefile at the project root makes management easy.
To build the Docker images and launch all services for the first time:
make all- Start the services:
make up
- Stop the services:
make stop
make all: Builds and starts everything.make build: Builds the Docker images.make up: Starts the services.make stop: Stops the containers without removing them.make down: Stops and removes containers and networks.make clean: Runsdownand removes the data directories (/home/madelvin/data/*).make fclean: Full cleanup. Removes everything: containers, networks, volumes, images, and data.make re: Runsfcleanthenall. Rebuilds everything from scratch.make logs: Shows the logs from all services.make ps: Shows the status of the containers.
Important data (database, WordPress files) is stored on your host machine so it isn't lost. The main folder is /home/madelvin/data, as defined in the Makefile.
It contains:
mariadb: Database files.wordpress: WordPress files (themes, plugins, uploads).
The docker-compose.yml file uses volumes to link host folders to containers:
mariadb_volume: Links the container's/var/lib/mysqlto/home/madelvin/data/mariadbon the host.wordpress_volume: Links the container's/var/www/htmlto/home/madelvin/data/wordpresson the host.adminer_volumeandportainer_volume: Docker-managed volumes for their own data.
To delete this data, you must use make clean or make fclean.