version: '3.8' services: postgres: image: postgres:18 ports: - '5432:5432' environment: - POSTGRES_PASSWORD=password - POSTGRES_DB=keycard volumes: - postgres:/var/lib/postgresql healthcheck: test: ['CMD-SHELL', 'pg_isready -h 127.0.0.1 -U postgres -d keycard'] interval: 2s timeout: 3s retries: 15 keycard-api: build: . depends_on: postgres: condition: service_healthy ports: - "3007:3007" env_file: - .env volumes: - .:/app - /app/node_modules volumes: postgres: driver: local