services: nginx: image: nginx:latest ports: - "8080:80" healthcheck: test: ["CMD", "nc", "-z", "-v", "localhost", "80"] interval: 5s timeout: 10s retries: 15 start_period: 5s networks: - app-network postgres: image: postgres:latest healthcheck: test: ["CMD", "nc", "-z", "-v", "localhost", "5432"] interval: 5s timeout: 10s retries: 15 start_period: 5s networks: - app-network networks: app-network: driver: bridge