Overview
Developers currently need to install Redis manually and manage environment variables by hand. A docker-compose.yml will let anyone run the full local stack with a single command.
docker-compose Services
services:
api:
build: .
ports:
- "4000:4000"
environment:
- REDIS_URL=redis://redis:6379
- DATABASE_URL=postgres://smartdrop:smartdrop@postgres:5432/smartdrop
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
volumes:
- ./src:/app/src # hot reload in dev
redis:
image: redis:7-alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: smartdrop
POSTGRES_PASSWORD: smartdrop
POSTGRES_DB: smartdrop
ports:
- "5432:5432"
healthcheck:
test: ["CMD", "pg_isready", "-U", "smartdrop"]
interval: 5s
Dockerfile
Multi-stage build:
builder stage: npm ci --omit=dev
production stage: copy node_modules + src from builder
Requirements
Dockerfile at repo root for production builds
docker-compose.yml for local dev (includes hot reload)
docker-compose.override.yml gitignored for local secrets
.dockerignore to exclude node_modules, .env, tests
- README section: Quick Start (
docker compose up)
Acceptance Criteria
Overview
Developers currently need to install Redis manually and manage environment variables by hand. A
docker-compose.ymlwill let anyone run the full local stack with a single command.docker-compose Services
Dockerfile
Multi-stage build:
builderstage:npm ci --omit=devproductionstage: copynode_modules+srcfrom builderRequirements
Dockerfileat repo root for production buildsdocker-compose.ymlfor local dev (includes hot reload)docker-compose.override.ymlgitignored for local secrets.dockerignoreto excludenode_modules,.env, testsdocker compose up)Acceptance Criteria
docker compose upstarts all services and API responds on port 4000src/file change in dev mode.env.examplevariables work with docker-compose defaults.dockerignorepresent and excludes sensitive files