docker-compose.yml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. version: '3.9'
  2. services:
  3. postgres:
  4. image: postgres:16-alpine
  5. restart: unless-stopped
  6. environment:
  7. POSTGRES_USER: timelapse
  8. POSTGRES_PASSWORD: timelapse_dev_password
  9. POSTGRES_DB: timelapse_dev
  10. volumes:
  11. - postgres_data:/var/lib/postgresql/data
  12. ports:
  13. - '5432:5432'
  14. healthcheck:
  15. test: ['CMD-SHELL', 'pg_isready -U timelapse']
  16. interval: 5s
  17. timeout: 5s
  18. retries: 5
  19. redis:
  20. image: redis:7-alpine
  21. restart: unless-stopped
  22. ports:
  23. - '6379:6379'
  24. volumes:
  25. - redis_data:/data
  26. healthcheck:
  27. test: ['CMD', 'redis-cli', 'ping']
  28. interval: 5s
  29. timeout: 5s
  30. retries: 5
  31. api-server:
  32. build:
  33. context: .
  34. dockerfile: apps/api-server/Dockerfile
  35. restart: unless-stopped
  36. environment:
  37. NODE_ENV: production
  38. PORT: '3001'
  39. DATABASE_URL: postgres://timelapse:timelapse_dev_password@postgres:5432/timelapse_dev
  40. REDIS_URL: redis://redis:6379
  41. JWT_SECRET: ${JWT_SECRET:-change-this-secret-in-production}
  42. CORS_ORIGIN: ${CORS_ORIGIN:-http://localhost:3000}
  43. GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
  44. GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET:-}
  45. GOOGLE_CALLBACK_URL: ${GOOGLE_CALLBACK_URL:-http://localhost:3001/v1/auth/google/callback}
  46. ports:
  47. - '3001:3001'
  48. depends_on:
  49. postgres:
  50. condition: service_healthy
  51. redis:
  52. condition: service_healthy
  53. volumes:
  54. - ./apps/api-server/src:/app/src:ro
  55. web-dashboard:
  56. build:
  57. context: .
  58. dockerfile: apps/web-dashboard/Dockerfile
  59. args:
  60. NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL}
  61. restart: unless-stopped
  62. environment:
  63. NODE_ENV: production
  64. NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL}
  65. ports:
  66. - '3000:3000'
  67. depends_on:
  68. - api-server
  69. worker:
  70. build:
  71. context: .
  72. dockerfile: apps/worker/Dockerfile
  73. restart: unless-stopped
  74. environment:
  75. NODE_ENV: production
  76. DATABASE_URL: postgres://timelapse:timelapse_dev_password@postgres:5432/timelapse_dev
  77. REDIS_URL: redis://redis:6379
  78. depends_on:
  79. postgres:
  80. condition: service_healthy
  81. redis:
  82. condition: service_healthy
  83. volumes:
  84. postgres_data:
  85. redis_data: