docker-compose.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. services:
  2. postgres:
  3. image: postgres:16-alpine
  4. container_name: vidreview-db
  5. environment:
  6. POSTGRES_USER: vidreview
  7. POSTGRES_PASSWORD: vidreview123
  8. POSTGRES_DB: vidreview
  9. ports:
  10. - '5432:5432'
  11. volumes:
  12. - postgres_data:/var/lib/postgresql/data
  13. healthcheck:
  14. test: ['CMD-SHELL', 'pg_isready -U vidreview']
  15. interval: 5s
  16. timeout: 5s
  17. retries: 5
  18. api:
  19. build:
  20. context: .
  21. dockerfile: Dockerfile.api
  22. container_name: vidreview-api
  23. environment:
  24. DATABASE_URL: postgresql://vidreview:vidreview123@postgres:5432/vidreview
  25. JWT_SECRET: ${JWT_SECRET:-change-me-in-production}
  26. JWT_EXPIRES_IN: ${JWT_EXPIRES_IN:-7d}
  27. API_PORT: 3001
  28. NODE_ENV: production
  29. UPLOAD_DIR: /app/uploads
  30. MAX_FILE_SIZE_MB: 500
  31. ALLOWED_ORIGINS: '*'
  32. ports:
  33. - '3001:3001'
  34. depends_on:
  35. postgres:
  36. condition: service_healthy
  37. volumes:
  38. - uploads:/app/uploads
  39. healthcheck:
  40. test: ['CMD-SHELL', 'wget -qO- http://localhost:3001/health || exit 1']
  41. interval: 10s
  42. timeout: 5s
  43. retries: 5
  44. frontend:
  45. build:
  46. context: .
  47. dockerfile: Dockerfile.frontend
  48. container_name: vidreview-frontend
  49. environment:
  50. NEXT_PUBLIC_API_URL: http://api:3001
  51. NODE_ENV: production
  52. ports:
  53. - '3000:3000'
  54. depends_on:
  55. api:
  56. condition: service_healthy
  57. volumes:
  58. postgres_data:
  59. uploads: