53 lines
1.3 KiB
YAML
53 lines
1.3 KiB
YAML
# Disposable test stack. Uses tmpfs so the normal data volume is never touched.
|
|
# docker compose -f docker-compose.test.yml up --build --abort-on-container-exit --exit-code-from api
|
|
|
|
name: buyingagent-test
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:17-alpine
|
|
environment:
|
|
POSTGRES_DB: buyingagent_test
|
|
POSTGRES_USER: buyingagent_test
|
|
POSTGRES_PASSWORD: test
|
|
tmpfs:
|
|
- /var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U buyingagent_test -d buyingagent_test"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
networks:
|
|
- buyingagent-test-network
|
|
|
|
api:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
target: test
|
|
environment:
|
|
DB_HOST: postgres
|
|
DB_PORT: "5432"
|
|
DB_NAME: buyingagent_test
|
|
DB_USER: buyingagent_test
|
|
DB_PASSWORD: test
|
|
ENVIRONMENT: test
|
|
ENGINE_BUILD: test
|
|
CLOCK_NOW: "2026-10-03T12:00:00Z"
|
|
GEIZHALS_USE_FIXTURES: "1"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
command:
|
|
[
|
|
"/bin/sh",
|
|
"-c",
|
|
"/app/.venv/bin/alembic upgrade head && /app/.venv/bin/pytest tests -ra --tb=short",
|
|
]
|
|
networks:
|
|
- buyingagent-test-network
|
|
|
|
networks:
|
|
buyingagent-test-network:
|
|
driver: bridge
|