services: api: container_name: todo-api hostname: todo-api depends_on: - db build: . env_file: - api/.env ports: - 80:80 healthcheck: test: ["CMD", "curl", "-f", "http://localhost/health"] interval: 10s timeout: 5s retries: 5 start_period: 15s db: container_name: db hostname: db image: mysql:latest env_file: - db/.env ports: - 3306:3306 healthcheck: test: ["CMD", "mysqladmin", "ping", "-h", "localhost"] interval: 10s timeout: 5s retries: 5