docker-compose.yml 3.0 KB

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