| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- x-env: &env
- POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-photoplaces_dev}
- REDIS_PASSWORD: ${REDIS_PASSWORD:-photoplaces_dev}
- MINIO_PASSWORD: ${MINIO_PASSWORD:-photoplaces_dev}
- services:
- postgres:
- image: postgis/postgis:16-3.4-alpine
- environment:
- POSTGRES_DB: photoplaces
- POSTGRES_USER: photoplaces
- POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-photoplaces_dev}
- ports:
- - "5432:5432"
- volumes:
- - pgdata:/var/lib/postgresql/data
- healthcheck:
- test: ["CMD-SHELL", "pg_isready -U photoplaces"]
- interval: 5s
- retries: 5
- redis:
- image: redis:7-alpine
- command: redis-server --requirepass ${REDIS_PASSWORD:-photoplaces_dev}
- ports:
- - "6379:6379"
- volumes:
- - redisdata:/data
- healthcheck:
- test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD:-photoplaces_dev}", "ping"]
- interval: 5s
- retries: 5
- minio:
- image: minio/minio:latest
- command: server /data --console-address ":9001"
- ports:
- - "9000:9000"
- - "9001:9001"
- volumes:
- - miniodata:/data
- environment:
- MINIO_ROOT_USER: photoplaces
- MINIO_ROOT_PASSWORD: ${MINIO_PASSWORD:-photoplaces_dev}
- healthcheck:
- test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
- interval: 5s
- retries: 5
- migrate:
- image: migrate/migrate:v4.17
- command: -path=/migrations -database "postgres://photoplaces:${POSTGRES_PASSWORD:-photoplaces_dev}@postgres:5432/photoplaces?sslmode=disable" up
- volumes:
- - ./backend/migrations:/migrations
- depends_on:
- postgres:
- condition: service_healthy
- profiles:
- - tools
- backend:
- build:
- context: ./backend
- dockerfile: Dockerfile
- ports:
- - "8080:8080"
- environment:
- APP_ENV: ${APP_ENV:-development}
- DATABASE_URL: postgres://photoplaces:${POSTGRES_PASSWORD:-photoplaces_dev}@postgres:5432/photoplaces?sslmode=disable
- REDIS_URL: redis://:${REDIS_PASSWORD:-photoplaces_dev}@redis:6379/0
- S3_ENDPOINT: ${S3_ENDPOINT:-minio:9000}
- S3_ACCESS_KEY: photoplaces
- S3_SECRET_KEY: ${MINIO_PASSWORD:-photoplaces_dev}
- S3_BUCKET: photoplaces
- JWT_SECRET: ${JWT_SECRET:-dev-secret}
- JWT_REFRESH_SECRET: ${JWT_REFRESH_SECRET:-dev-refresh-secret}
- CLOUDPAYMENTS_PUBLIC_ID: ""
- CLOUDPAYMENTS_API_SECRET: ""
- depends_on:
- postgres:
- condition: service_healthy
- redis:
- condition: service_healthy
- minio:
- condition: service_healthy
- volumes:
- - ./backend:/app
- healthcheck:
- test: ["CMD", "curl", "-sf", "http://localhost:8080/api/v1/health"]
- interval: 10s
- timeout: 5s
- retries: 5
- start_period: 10s
- frontend:
- build:
- context: ./frontend
- dockerfile: Dockerfile
- ports:
- - "3000:3000"
- environment:
- NEXT_PUBLIC_API_URL: http://localhost:8080/api/v1
- NEXT_PUBLIC_GIT_HASH: ${NEXT_PUBLIC_GIT_HASH:-dev}
- depends_on:
- backend:
- condition: service_healthy
- volumes:
- - ./frontend:/app
- - frontend-modules:/app/node_modules
- healthcheck:
- test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000"]
- interval: 10s
- timeout: 5s
- retries: 5
- start_period: 15s
- volumes:
- pgdata:
- redisdata:
- miniodata:
- backend-modules:
- frontend-modules:
|