version: '3.8' services: server: build: . container_name: server networks: - my_network ports: - "7878:7878" command: ["./target/release/server"] healthcheck: test: ["CMD", "curl", "-f", "http://localhost:7878"] interval: 10s timeout: 5s retries: 3 client: build: . container_name: client networks: - my_network depends_on: server: condition: service_healthy command: ["sh", "-c", "sleep 10 && ./target/release/client"] environment: - RUST_BACKTRACE=1 networks: my_network: driver: bridge