Custom Nginx docker image files: NGINX + Supervisord + Certbot (fastcgi_cache ready).
- NGINX (official
nginximage base) - Supervisord (nginx + cron)
- Certbot (
python3-certbot-nginx) with aletsencrypt-autocompatibility shim
The nginx version is a build argument (default 1.31.9, the fixed release for CVE-2026-123007 / NGINX2Root):
docker build --build-arg NGINX_VERSION=1.31.9 -t trydirect/nginx:latest .docker compose up -d
# or
docker run -d -p 80:80 -p 443:443 trydirect/nginx:latestnginx runs under supervisord; workers run as www-data, pid/temp paths live
under /tmp. Mount site configs into /etc/nginx/conf.d/ and certificates
into /etc/letsencrypt.
Certbot comes from Debian (python3-certbot-nginx):
docker exec <container> certbot --nginx -d example.com -d www.example.com/opt/letsencrypt/letsencrypt-auto is kept as a thin shim that forwards to
certbot for backwards compatibility with older cron jobs and docs (the
historical certbot-auto script was retired by EFF and no longer works).
docker compose build
docker compose up -d
python3 tests.py # smoke tests (needs: pip install docker)
docker compose downCI builds, lints (hadolint) and runs the smoke tests on every push; image
publishing to Docker Hub is a manual workflow_dispatch action.