services: app: build: . ports: - "8080:8080" environment: # Override the local-dev default — "mongodb" resolves to the service below MONGODB_URI: mongodb://mongodb:27017/kotlin-api # Interpolated from .env (copy .env.example → .env and fill in the value) JWT_ENCRYPTION_SECRET: ${JWT_ENCRYPTION_SECRET} depends_on: mongodb: condition: service_healthy networks: - backend mongodb: # mongo:8.0 image: mongo@sha256:f93b9015613e393b76fdf4fb71f3435ece6a3b46cc56c62c08875ad08442aa4c ports: - "27017:27017" environment: MONGO_INITDB_DATABASE: kotlin-api volumes: - mongodb_data:/data/db healthcheck: test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"] interval: 10s timeout: 5s retries: 5 start_period: 10s networks: - backend networks: backend: driver: bridge volumes: mongodb_data: