# Server development stack: ~/docker/buyingagent-dev # No fixed container_name — Compose prefixes with the project name. services: postgres: image: postgres:17-alpine environment: POSTGRES_DB: "${DB_NAME:-buyingagent_dev}" POSTGRES_USER: "${DB_USER:-buyingagent_dev}" POSTGRES_PASSWORD: "${DB_PASSWORD:-dev_password_change_me}" volumes: - dev-buyingagent-db-data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-buyingagent_dev} -d ${DB_NAME:-buyingagent_dev}"] interval: 5s timeout: 5s retries: 10 restart: unless-stopped networks: - dev-buyingagent-network api: build: context: ./backend dockerfile: Dockerfile target: runtime environment: DB_HOST: postgres DB_PORT: "5432" DB_NAME: "${DB_NAME:-buyingagent_dev}" DB_USER: "${DB_USER:-buyingagent_dev}" DB_PASSWORD: "${DB_PASSWORD:-dev_password_change_me}" ENVIRONMENT: "${ENVIRONMENT:-development}" ENGINE_BUILD: "${ENGINE_BUILD:-dev}" CORS_ALLOWED_ORIGINS: "${CORS_ALLOWED_ORIGINS:-http://localhost:5173,http://127.0.0.1:5173,http://192.168.2.49:5174}" ports: - "${BUYING_AGENT_API_PORT:-8095}:8000" depends_on: postgres: condition: service_healthy healthcheck: test: [ "CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health/ready')", ] interval: 10s timeout: 5s retries: 18 start_period: 90s restart: unless-stopped networks: - dev-buyingagent-network frontend: build: context: ./frontend dockerfile: Dockerfile environment: API_PROXY_TARGET: http://api:8000 ports: - "${BUYING_AGENT_FRONTEND_PORT:-5174}:80" depends_on: api: condition: service_healthy restart: unless-stopped networks: - dev-buyingagent-network api-test: profiles: ["test"] build: context: ./backend dockerfile: Dockerfile target: test environment: DB_HOST: postgres DB_PORT: "5432" DB_NAME: "${DB_NAME:-buyingagent_dev}" DB_USER: "${DB_USER:-buyingagent_dev}" DB_PASSWORD: "${DB_PASSWORD:-dev_password_change_me}" ENVIRONMENT: test ENGINE_BUILD: test CLOCK_NOW: "2026-10-03T12:00:00Z" depends_on: postgres: condition: service_healthy networks: - dev-buyingagent-network volumes: dev-buyingagent-db-data: networks: dev-buyingagent-network: driver: bridge