Summary
Product doc section 6.4 specifies DevCard must be fully self-hostable via Docker Compose. Create a working docker-compose.yml at the project root that spins up all services: PostgreSQL, Redis, backend, and web.
Context
The monorepo root already has a package.json and pnpm workspace. The backend uses Fastify (apps/backend) and the web app uses SvelteKit (apps/web). The backend references DATABASE_URL and environment variables in apps/backend/src/env.ts.
Tasks
Acceptance Criteria
Difficulty
senior — requires Docker multi-stage build expertise, service dependency management, volume persistence, and environment variable security practices.
Summary
Product doc section 6.4 specifies DevCard must be fully self-hostable via Docker Compose. Create a working
docker-compose.ymlat the project root that spins up all services: PostgreSQL, Redis, backend, and web.Context
The monorepo root already has a
package.jsonand pnpm workspace. The backend uses Fastify (apps/backend) and the web app uses SvelteKit (apps/web). The backend referencesDATABASE_URLand environment variables inapps/backend/src/env.ts.Tasks
docker-compose.ymlat the project root with services:db:postgres:15-alpinewithPOSTGRES_DB,POSTGRES_USER,POSTGRES_PASSWORDenv vars, persistent named volume.redis:redis:7-alpinewith persistent volume.backend: built fromapps/backend/Dockerfile(createDockerfileif it doesn't exist), depends ondbandredis, exposes port 3001.web: built fromapps/web/Dockerfile(create if needed), depends onbackend, exposes port 5173.apps/backend/Dockerfileusing multi-stage build: install deps → compile TypeScript → run production image.apps/web/Dockerfileusing Node + SvelteKit adapter-node or adapter-static..env.exampleat root with all required env vars and explanatory comments.docker-compose.override.ymlfor dev-mode hot-reload mounts.README.mdwith a Self-Hosting section using the Compose workflow.docker compose upand confirming health check atlocalhost:3001/health.Acceptance Criteria
docker compose upbrings up all services without errors./healthresponds 200 from within the compose network.localhost:5173.docker compose down && docker compose up.Difficulty
senior— requires Docker multi-stage build expertise, service dependency management, volume persistence, and environment variable security practices.