docker-compose.yml 1.6 KB

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