services: redis: image: redis:7-alpine restart: unless-stopped volumes: - redis-data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 3 app: build: . restart: unless-stopped ports: - "${APP_PORT:-3000}:3000" env_file: .env environment: - RAILS_ENV=production - RAILS_MASTER_KEY=${RAILS_MASTER_KEY} - REDIS_HOST=redis volumes: - db-data:/home/rails/coredns-app-db depends_on: redis: condition: service_healthy coredns: build: context: . dockerfile: Dockerfile.coredns restart: unless-stopped ports: - "53:53/udp" - "53:53/tcp" cap_add: - NET_BIND_SERVICE volumes: - ./Corefile:/etc/coredns/Corefile:ro depends_on: redis: condition: service_healthy healthcheck: test: ["CMD", "wget", "-q", "--spider", "http://localhost:8053/health"] interval: 10s timeout: 5s retries: 3 volumes: redis-data: db-data: