version: '3.7' services: server: build: context: ./server target: 'develop-stage' ports: - "8080:8080" depends_on: db: condition: service_healthy volumes: - ./server:/app - cargo-cache:/usr/local/cargo/registry - target-cache:/app/target command: /bin/sh -c "diesel setup && cargo watch -x run" tty: true db: build: context: ./db ports: - '5432:5432' environment: POSTGRES_USER: admin POSTGRES_PASSWORD: password POSTGRES_DB: postgres volumes: - ./db/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d healthcheck: test: ["CMD-SHELL", "pg_isready", "-U", "admin", "-d", "postgres"] interval: 10s timeout: 5s retries: 5 volumes: cargo-cache: target-cache: