version: "v2" services: postgres: image: postgres:15.4-alpine environment: - POSTGRES_DB=merc - POSTGRES_USER=merc - POSTGRES_PASSWORD=merc ports: - 15432:5432 healthcheck: test: pg_isready -U merc -d merc interval: 5s timeout: 3s retries: 5 api: image: merc-api ports: - 3000:3000 build: dockerfile: ./Dockerfile depends_on: postgres: condition: service_healthy profiles: - with_api