docker-compose.yml 929 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. services:
  2. payload:
  3. build:
  4. context: .
  5. dockerfile: Dockerfile
  6. image: hanoman-website-be:latest
  7. restart: unless-stopped
  8. ports:
  9. - '3000:3000'
  10. depends_on:
  11. postgres:
  12. condition: service_healthy
  13. env_file:
  14. - .env
  15. environment:
  16. NODE_ENV: production
  17. DATABASE_URL: ${DATABASE_URL}
  18. # Ensure DATABASE_URL points to this service when running in Docker:
  19. # postgresql://postgres:postgres@postgres:5432/hanoman
  20. postgres:
  21. restart: unless-stopped
  22. image: postgres:16
  23. environment:
  24. POSTGRES_DB: ${POSTGRES_DB}
  25. POSTGRES_USER: ${POSTGRES_USER}
  26. POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
  27. volumes:
  28. - pgdata:/var/lib/postgresql/data
  29. ports:
  30. - "5432:5432"
  31. healthcheck:
  32. test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
  33. interval: 10s
  34. timeout: 5s
  35. retries: 5
  36. volumes:
  37. pgdata: