215772b0bca6a9765e0b4c7d207cb90f202d35d2
DigitechFlow WordPress Stack
This repository contains a hardened Docker Compose stack for the DigitechFlow WordPress deployment. It runs MySQL, WordPress (PHP-FPM), Nginx, and Valkey (Redis-compatible cache) with sensible defaults.
Prerequisites
- Docker Engine + Docker Compose V2
- Traefik network (
traefik_default) already present for routing/SSL - Host directories writable for
db_data/,wordpress_data/, andredis_data/
Getting Started
- Copy the environment template and fill in secrets:
cp .env.example .env # Edit .env to use strong unique values (DB creds, salts) - Bring up the stack:
docker compose up -d - Access WordPress via the configured Traefik domain (e.g., https://digitechflow.com).
Services
- db:
mysql:latestwith persistent volumedb_data/. - wordpress:
wordpress:php8.3-fpmserving PHP over FastCGI. - wpcli_seed: one-shot
wordpress:clijob that installs/activates plugins listed inconfig/plugins.txt. - wordpress_nginx:
nginx:latestfront-end with custom config tuned for Traefik and FastCGI. - redis:
valkey/valkey:latestfor object caching with persistence and healthcheck.
Configuration Highlights
- Secrets and database settings sourced from
.env; the template (.env.example) documents required keys. config/nginx/default.confcontains gzip, caching, and FastCGI tuning. Adjust if you need custom routes.wordpress.inisets PHP limits and Opcache recommendations.- Local data directories (
db_data/,wordpress_data/,redis_data/) pluswp-config.phpare gitignored to prevent leaking content/secrets. config/plugins.txtlists plugin slugs to auto-install. Add one per line and rerundocker compose up wpcli_seed.
Managing the plugin seed list
config/plugins.txt is a newline-delimited list of plugin slugs (directory names from wordpress.org). To ensure a plugin is installed and active whenever this stack boots:
- Add the slug to the file, e.g.
wordpress-seo. - Run
docker compose up wpcli_seed. The one-shotwordpress:clicontainer will wait for WordPress to be ready, install any missing plugins from the list, and activate them. - Repeat whenever you add/remove required plugins. Existing installations are left untouched unless they match entries in the file (in which case they’re only ensured active).
Operations
- Update images:
docker compose pull && docker compose up -d. - View logs:
docker compose logs -f <service>. - Run WordPress CLI tasks:
docker compose exec wordpress wp <command>(install WP-CLI first if needed).
Security Notes
- Always use unique, strong passwords in
.envand rotate them periodically. - Regenerate WordPress auth salts via https://api.wordpress.org/secret-key/1.1/salt/ and store them in
.env. - Ensure Traefik enforces HTTPS and apply rate limiting/WAF middleware as needed.
- Schedule backups (database dumps +
wordpress_data) off-host; the stack does not include automated backups by default.
Troubleshooting
- Bad gateway from Nginx usually means PHP-FPM isn’t reachable; check
docker compose logs wordpress wordpress_nginx. - If Compose warns about
version: '3', you can remove that line—it’s optional with Compose V2. - Ensure the Traefik network exists:
docker network ls | grep traefik_default.
Description
Languages
Shell
100%