User Documentation (USER_DOC)
1. Services Overview
This Docker Infrastructure stack provides a secure, containerized web infrastructure.
- NGINX: The entry point (Gateway). Access via
https://local.dev. - WordPress: A blogging platform running on PHP 8.2.
- MariaDB: The database storing WordPress content.
- Redis: Caching service to speed up WordPress.
- FTP Server: Access to WordPress files (themes, plugins, uploads).
- Adminer: Web interface to manage the MariaDB database.
- Static Website: A bonus site showcasing the project documentation.
2. Start and Stop the Project
All commands must be run from the root of the repository using make.
Start:
bashmakeThis builds images and starts containers in the background.
Stop:
bashmake downThis stops and removes the containers and network.
Restart:
bashmake re
3. Accessing Services
Add the following line to your /etc/hosts file to resolve the domain:
127.0.0.1 local.dev- Main Website: https://local.dev
- WordPress Admin: https://local.dev/wp-admin
- Adminer (DB Admin): https://local.dev/adminer
- Static Website: https://local.dev/website
Note: You will see a security warning because we use a self-signed certificate. You can safely accept it for this local environment.
4. Configuration & Credentials
The project separates non-sensitive configuration from sensitive credentials for better security.
Configuration (.env)
Non-sensitive environment variables (e.g., Domain Name, Database Host) are defined in the .env file located in srcs/.
Secrets (secrets/)
Sensitive information (passwords, API keys) is NOT stored in .env. Instead, it is managed via Docker Secrets. Each secret is stored as a single file within the secrets/ directory.
- Generation: The administrator should generate these files using tools or scripts (e.g.,
secrets/gen_secret_txt.sh). - Usage: Services mount these files at
/run/secrets/<secret_name>at runtime.
For detailed security implementation, please refer to: Data Security Guide
5. Checking Service Status
To verify everything is running correctly:
docker psAll containers (nginx, wordpress, mariadb, redis, ftp, website, adminer) should be in Up status. For WordPress/MariaDB/Redis, look for (healthy) status indicating they passed health checks.
Startup Note: WordPress will wait for MariaDB and Redis to be healthy before starting. This ensures a stable connection.