| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- services:
- payload:
- build:
- context: .
- dockerfile: Dockerfile
- image: hanoman-website-be:latest
- restart: unless-stopped
- ports:
- - '3000:3000'
- depends_on:
- postgres:
- condition: service_healthy
- env_file:
- - .env
- environment:
- NODE_ENV: production
- DATABASE_URL: ${DATABASE_URL}
- # Ensure DATABASE_URL points to this service when running in Docker:
- # postgresql://postgres:postgres@postgres:5432/hanoman
- postgres:
- restart: unless-stopped
- image: postgres:16
- environment:
- POSTGRES_DB: ${POSTGRES_DB}
- POSTGRES_USER: ${POSTGRES_USER}
- POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
- volumes:
- - pgdata:/var/lib/postgresql/data
- ports:
- - "5432:5432"
- healthcheck:
- test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
- interval: 10s
- timeout: 5s
- retries: 5
- # One-off DB seeding on the same Docker network as Postgres (hostname "postgres" in DATABASE_URL works).
- # Usage: docker compose --profile seed run --rm seed
- seed:
- profiles:
- - seed
- image: node:22.17.0-alpine
- working_dir: /app
- volumes:
- - .:/app
- env_file:
- - .env
- environment:
- NODE_ENV: development
- depends_on:
- postgres:
- condition: service_healthy
- command:
- - sh
- - -c
- - corepack enable && corepack prepare pnpm@10.33.0 --activate && pnpm install --frozen-lockfile && pnpm seed
- volumes:
- pgdata:
|