services: nginx: image: nginx:latest ports: - "8080:80" healthcheck: test: ["CMD-SHELL", "curl -f http://localhost || exit 1"] interval: 5s timeout: 10s retries: 15 start_period: 5s networks: - app-network postgres: image: postgres:latest environment: POSTGRES_DB: mydb POSTGRES_USER: user POSTGRES_PASSWORD: password healthcheck: test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB} || exit 1"] interval: 5s timeout: 10s retries: 15 start_period: 5s networks: - app-network redis: image: redis:latest healthcheck: test: ["CMD-SHELL", "redis-cli ping | grep PONG || exit 1"] interval: 5s timeout: 10s retries: 15 start_period: 5s networks: - app-network networks: app-network: driver: bridge