BuyingAgent/docker-compose.yml
Lars 46857715df
Some checks failed
Deploy Development / deploy (push) Successful in 1m49s
Test Suite / pytest-backend (push) Failing after 32s
Test Suite / smoke-dev (push) Successful in 0s
Test Suite / frontend-checks (push) Successful in 30s
Lerne Taxonomie und Trefferliste live von Geizhals, damit Wizard und Kandidaten echte Quelldaten nutzen.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-04 14:53:08 +02:00

84 lines
2.3 KiB
YAML

# Local skeleton and production stack.
# Local default: 127.0.0.1:8000. Production on the Pi: 0.0.0.0:8006 via .env.
# Host path on the server: ~/docker/buyingagent
services:
postgres:
image: postgres:17-alpine
container_name: buyingagent-db-prod
environment:
POSTGRES_DB: "${DB_NAME:-buyingagent}"
POSTGRES_USER: "${DB_USER:-buyingagent}"
POSTGRES_PASSWORD: "${DB_PASSWORD:-change_me}"
volumes:
- buyingagent-db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-buyingagent} -d ${DB_NAME:-buyingagent}"]
interval: 5s
timeout: 5s
retries: 10
restart: unless-stopped
networks:
- buyingagent-network
api:
build:
context: ./backend
dockerfile: Dockerfile
target: runtime
container_name: buyingagent-api
environment:
DB_HOST: postgres
DB_PORT: "5432"
DB_NAME: "${DB_NAME:-buyingagent}"
DB_USER: "${DB_USER:-buyingagent}"
DB_PASSWORD: "${DB_PASSWORD:-change_me}"
ENVIRONMENT: "${ENVIRONMENT:-production}"
ENGINE_BUILD: "${ENGINE_BUILD:-dev}"
CORS_ALLOWED_ORIGINS: "${CORS_ALLOWED_ORIGINS:-http://localhost:4173,http://127.0.0.1:4173}"
GEIZHALS_USE_FIXTURES: "${GEIZHALS_USE_FIXTURES:-0}"
GEIZHALS_PLAYWRIGHT: "${GEIZHALS_PLAYWRIGHT:-1}"
ports:
- "${BUYING_AGENT_API_BIND:-127.0.0.1}:${BUYING_AGENT_API_PORT:-8000}: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: 12
start_period: 60s
restart: unless-stopped
networks:
- buyingagent-network
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: buyingagent-frontend
environment:
API_PROXY_TARGET: http://api:8000
ports:
- "${BUYING_AGENT_FRONTEND_BIND:-127.0.0.1}:${BUYING_AGENT_FRONTEND_PORT:-4173}:80"
depends_on:
api:
condition: service_healthy
restart: unless-stopped
networks:
- buyingagent-network
volumes:
buyingagent-db-data:
networks:
buyingagent-network:
driver: bridge