docker-compose.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. restart: unless-stopped
  60. environment:
  61. NODE_ENV: production
  62. NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-http://localhost:3001}
  63. ports:
  64. - '3000:3000'
  65. depends_on:
  66. - api-server
  67. worker:
  68. build:
  69. context: .
  70. dockerfile: apps/worker/Dockerfile
  71. restart: unless-stopped
  72. environment:
  73. NODE_ENV: production
  74. DATABASE_URL: postgres://timelapse:timelapse_dev_password@postgres:5432/timelapse_dev
  75. REDIS_URL: redis://redis:6379
  76. depends_on:
  77. postgres:
  78. condition: service_healthy
  79. redis:
  80. condition: service_healthy
  81. volumes:
  82. postgres_data:
  83. redis_data: