# Dev-only overlay. NOT loaded automatically (unlike docker-compose.override.yml). # Opt in explicitly for local development when you need host access to Postgres: # docker compose -f docker-compose.yml -f docker-compose.dev.yml up # Never use this overlay in production — it publishes the database port on the host. services: db: ports: - "5432:5432" app: # Relax the production secret guard for local dev — the dev sentinel JWT_SECRET # is tolerated (warned) rather than rejected. environment: APP_ENV: development # `.env` sets DATABASE_URL to @localhost for the run-backend-natively workflow # (the db port is published above for that). When the app runs IN a container, # localhost is the app itself — point it at the `db` service instead. Creds are # interpolated from .env so nothing is hardcoded. DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB} # `.env` sets MEDIA_PATH to a HOST path (/home/fabi/EventSnap/media) for the # run-backend-natively workflow. In a container that path doesn't exist and the # app user can't create it from `/`, so every upload 500s with EACCES. The media # volume is mounted at /media (see docker-compose.yml) — point the app there. MEDIA_PATH: /media # Recent Docker Compose interpolates env_file values, so the `$` segments of the # bcrypt ADMIN_PASSWORD_HASH in .env get eaten (the salt reads as an unset var) — # every admin login then 401s. Re-supply it here with `$` doubled to `$$` so Compose # passes the literal hash. NOTE: production (docker-compose.yml + .env) has the SAME # bug — escape the hash as `$$` in .env, or set it via `environment:` there too. ADMIN_PASSWORD_HASH: "$$2b$$12$$PAteqCNpsbm6d0HTJcywfOaUovjAU.iNVlsL7EDYaRC/z4P/xv7ye" # Smoke-testing the comment kill-switch: boot-time flag, so it needs a restart # (not an admin-UI toggle). Backend rejects new comments (403) and the frontend # hides the whole comment UI. Flip back to true (or drop this line) to restore. COMMENTS_ENABLED: "false" caddy: # The prod caddy service has no env_file, so the Caddyfile's `{$DOMAIN}` expands # to empty and the site block collapses into a malformed global block. Supply it # for local dev (from .env → localhost, which Caddy serves with a local self-signed # cert). NOTE: the prod compose likely needs DOMAIN wired to caddy too. environment: DOMAIN: ${DOMAIN}