mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2026-07-31 07:49:07 -04:00
- Expanded .trivyignore to include additional CVEs and clarified comments regarding esbuild vulnerabilities. - Changed the base image in Dockerfile from gcr.io to cgr.dev for the frontend, ensuring up-to-date dependencies.
Docker
All production images are built from a single Dockerfile with shared stages so frontend, backend, and Standard Deployment stay in sync.
Build commands (from repository root)
# Individual images
docker build -f docker/Dockerfile --target frontend -t adventurelog-frontend .
docker build -f docker/Dockerfile --target backend -t adventurelog-backend .
docker build -f docker/Dockerfile --target aio -t adventurelog .
# All app images
docker buildx bake -f docker/docker-bake.hcl
Layout
| Path | Purpose |
|---|---|
Dockerfile |
Multi-target build (frontend, backend, Standard Deployment) |
docker-bake.hcl |
Optional bake file for all targets |
shared/ |
nginx, supervisord, and entrypoint scripts shared across images |
aio/ |
Standard Deployment container entrypoint and env setup scripts |
docker-compose.yml |
Standard Deployment (single container) |
docker-compose.advanced.yml |
Advanced Deployment (frontend, backend, database) |
docker-compose*.yml |
Development, Traefik, database-only, and CI stacks |
Run compose files from the repository root, for example:
docker compose --env-file .env -f docker/docker-compose.yml up -d
Advanced Deployment:
docker compose --env-file .env.advanced -f docker/docker-compose.advanced.yml up -d
Shared stages
frontend-build— pnpm install, Vite build, production prune (used byfrontendand Standard Deployment)backend-builder— pip install with GDAL dev headersbackend-runtime— Django app, collectstatic, cron scripts (extended bybackendand Standard Deployment)
Image-specific layers only add nginx/supervisord configs, entrypoints, and (for Standard Deployment) Node + frontend artifacts.
Slimming
Build context exclusions live in the repository root .dockerignore. Never commit local backend/server/media/, .venv/, or staticfiles/ — they are mounted or generated at runtime.