name: dental-chat-agent services: postgres: image: postgres:16-alpine environment: POSTGRES_USER: dental POSTGRES_PASSWORD: dental POSTGRES_DB: dental ports: - "${PG_PORT:-55433}:5432" volumes: - ./db/schema.sql:/docker-entrypoint-initdb.d/01-schema.sql:ro - ./db/seed.sql:/docker-entrypoint-initdb.d/02-seed.sql:ro healthcheck: test: ["CMD-SHELL", "pg_isready -U dental -d dental"] interval: 3s timeout: 3s retries: 20 agent: build: . env_file: - path: .env required: false environment: DATABASE_URL: postgresql://dental:dental@postgres:5432/dental PORT: "8080" ports: - "${AGENT_PORT:-18080}:8080" depends_on: postgres: condition: service_healthy healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/health')"] interval: 5s timeout: 3s retries: 20