Skip to content

Latest commit

 

History

History
104 lines (69 loc) · 2.43 KB

File metadata and controls

104 lines (69 loc) · 2.43 KB

USER_DOC

1. Service overview

This infrastructure provides a complete web hosting stack with three isolated containers:

  • NGINX: entry point for the website, handles HTTPS traffic and serves/reverse-proxies requests.
  • WordPress (PHP-FPM): CMS application where the site is configured and managed.
  • MariaDB: database engine that stores WordPress content and user data.

All services communicate through an internal Docker network.

2. Managing the project

The project is controlled by the root Makefile.

Start the infrastructure

From the repository root:

make

This builds images (if needed) and starts the stack.

Stop the infrastructure

make down

Cleanup options

make clean   # stop stack and remove named volumes
make fclean  # full cleanup (containers, images, volumes, and host data directories)

3. Accessing the services

Before opening the website, add this line to your host /etc/hosts:

127.0.0.1   anikitin.42.fr

Website

  • https://anikitin.42.fr

Admin panel

  • https://anikitin.42.fr/wp-admin

Browser note: because this setup commonly uses a self-signed certificate, your browser may show a warning page. Accept the warning to continue.

HTTP (:80) is not exposed in this project; use HTTPS.

4. Locating and managing credentials

Sensitive credentials are stored in secrets/:

  • secrets/credentials.txt (WordPress admin/user setup values)
  • secrets/db_password.txt (MariaDB user password)
  • secrets/db_root_password.txt (MariaDB root password)

Non-sensitive runtime configuration is in srcs/.env:

  • domain and URL (DOMAIN_NAME, WP_URL)
  • database connection settings (DB_NAME, DB_USER, DB_HOST)
  • WordPress title (WP_TITLE)

Security recommendations:

  • do not commit real secret values to public repositories;
  • rotate credentials by updating secret files, then recreate affected containers.

5. Checking service status

List running services:

docker compose -f srcs/docker-compose.yml --env-file srcs/.env ps

Expected result: nginx, wordpress, and mariadb are Up.

Check logs (all services):

make logs

Check logs (single service):

docker compose -f srcs/docker-compose.yml --env-file srcs/.env logs nginx

Validate HTTPS endpoint:

curl -kI https://anikitin.42.fr

Optional HTTP check (should fail because port 80 is not exposed):

curl -I http://anikitin.42.fr