version: '3.8' services: usermanager-api: container_name: fids_usermanager_api image: ${API_IMAGE} ports: - 5001:5000 healthcheck: test: ["CMD", "nc", "-vz", "-w1", "localhost", "5000"] interval: 2s timeout: 2s retries: 5 start_period: 2s environment: - TEST_TARGET=${TEST_TARGET} - PORT=5000 - DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASS}@usermanager-db/${POSTGRES_DB} - APP_SETTINGS=${APP_SETTINGS} depends_on: usermanager-db: condition: service_healthy usermanager-db: container_name: fids_usermanager_db build: context: ./db dockerfile: Dockerfile healthcheck: test: psql postgres --command "select 1" -U ${POSTGRES_USER} interval: 2s timeout: 10s retries: 10 start_period: 2s expose: - 5432 environment: - POSTGRES_USER=${POSTGRES_USER} - POSTGRES_PASSWORD=${POSTGRES_PASS}