BuyingAgent/docker-compose.yml
Lars 0b3af2dee4
Some checks failed
Deploy Development / deploy (push) Failing after 10s
Test Suite / smoke-dev (push) Successful in 1s
Verwende ~/docker/buyingagent als kanonische Server-Pfade.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-03 11:03:06 +02:00

65 lines
1.7 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: .
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}"
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
volumes:
buyingagent-db-data:
networks:
buyingagent-network:
driver: bridge