docker-compose.yml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. version: "3.9"
  2. services:
  3. postgres:
  4. image: postgis/postgis:16-3.4-alpine
  5. environment:
  6. POSTGRES_DB: photoplaces
  7. POSTGRES_USER: photoplaces
  8. POSTGRES_PASSWORD: photoplaces_dev
  9. ports:
  10. - "5432:5432"
  11. volumes:
  12. - pgdata:/var/lib/postgresql/data
  13. healthcheck:
  14. test: ["CMD-SHELL", "pg_isready -U photoplaces"]
  15. interval: 5s
  16. retries: 5
  17. redis:
  18. image: redis:7-alpine
  19. command: redis-server --requirepass photoplaces_dev
  20. ports:
  21. - "6379:6379"
  22. volumes:
  23. - redisdata:/data
  24. healthcheck:
  25. test: ["CMD", "redis-cli", "-a", "photoplaces_dev", "ping"]
  26. interval: 5s
  27. retries: 5
  28. minio:
  29. image: minio/minio:latest
  30. command: server /data --console-address ":9001"
  31. ports:
  32. - "9000:9000"
  33. - "9001:9001"
  34. volumes:
  35. - miniodata:/data
  36. environment:
  37. MINIO_ROOT_USER: photoplaces
  38. MINIO_ROOT_PASSWORD: photoplaces_dev
  39. healthcheck:
  40. test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
  41. interval: 5s
  42. retries: 5
  43. migrate:
  44. image: migrate/migrate:v4.17
  45. command: -path=/migrations -database "postgres://photoplaces:photoplaces_dev@postgres:5432/photoplaces?sslmode=disable" up
  46. volumes:
  47. - ./backend/migrations:/migrations
  48. depends_on:
  49. postgres:
  50. condition: service_healthy
  51. profiles:
  52. - tools
  53. backend:
  54. build:
  55. context: ./backend
  56. dockerfile: Dockerfile
  57. ports:
  58. - "8080:8080"
  59. environment:
  60. APP_ENV: development
  61. DATABASE_URL: postgres://photoplaces:photoplaces_dev@postgres:5432/photoplaces?sslmode=disable
  62. REDIS_URL: redis://:photoplaces_dev@redis:6379/0
  63. S3_ENDPOINT: http://minio:9000
  64. S3_ACCESS_KEY: photoplaces
  65. S3_SECRET_KEY: photoplaces_dev
  66. S3_BUCKET: photoplaces
  67. JWT_SECRET: dev-secret-change-in-production
  68. CLOUDPAYMENTS_PUBLIC_ID: ""
  69. CLOUDPAYMENTS_API_SECRET: ""
  70. depends_on:
  71. postgres:
  72. condition: service_healthy
  73. redis:
  74. condition: service_healthy
  75. minio:
  76. condition: service_healthy
  77. volumes:
  78. - ./backend:/app
  79. - backend-modules:/app/node_modules
  80. healthcheck:
  81. test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/api/v1/health"]
  82. interval: 10s
  83. timeout: 5s
  84. retries: 5
  85. start_period: 10s
  86. frontend:
  87. build:
  88. context: ./frontend
  89. dockerfile: Dockerfile
  90. ports:
  91. - "3000:3000"
  92. environment:
  93. NEXT_PUBLIC_API_URL: http://localhost:8080/api/v1
  94. NEXT_PUBLIC_MAP_PROVIDER: yandex
  95. NEXT_PUBLIC_YANDEX_MAPS_API_KEY: ""
  96. depends_on:
  97. backend:
  98. condition: service_healthy
  99. volumes:
  100. - ./frontend:/app
  101. - frontend-modules:/app/node_modules
  102. healthcheck:
  103. test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000"]
  104. interval: 10s
  105. timeout: 5s
  106. retries: 5
  107. start_period: 15s
  108. volumes:
  109. pgdata:
  110. redisdata:
  111. miniodata:
  112. backend-modules:
  113. frontend-modules: