services: postgres: image: postgres:15-alpine env_file: - ../../.env.prod ports: - "5432:5432" volumes: - backend_postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] interval: 10s timeout: 5s retries: 10 restart: unless-stopped dragonfly: image: docker.dragonflydb.io/dragonflydb/dragonfly:latest env_file: - ../../.env.prod command: ["sh", "-c", "exec dragonfly --requirepass \"$${REDIS_PASSWORD}\" --proactor_threads=1 --maxmemory=256mb --dir=/data"] ports: - "6379:6379" volumes: - backend_dragonfly_data:/data healthcheck: test: ["CMD-SHELL", "redis-cli -a \"$${REDIS_PASSWORD}\" ping | grep PONG"] interval: 10s timeout: 5s retries: 10 restart: unless-stopped backend: build: context: . dockerfile: Dockerfile env_file: - ../../.env.prod ports: - "8080:8080" depends_on: postgres: condition: service_healthy dragonfly: condition: service_healthy restart: unless-stopped healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:8080/health"] interval: 30s timeout: 10s retries: 3 volumes: backend_postgres_data: backend_dragonfly_data: