Files
training-software/docker-compose.test.yml
Paperclip CTO 1bb4f4c3e3
All checks were successful
CI Build / Build Container (push) Successful in 5s
CI Quality / Ruff Lint (push) Successful in 7s
CI Security / Bandit + pip-audit (push) Successful in 26s
CI Tests / Django Tests (push) Successful in 39s
CI Tests / OpenAPI Schema (push) Successful in 13s
Fix docker env defaults and clarify frontend entrypoints
2026-05-19 22:29:47 +02:00

53 lines
1.2 KiB
YAML

services:
db-test:
image: postgres:16-alpine
environment:
POSTGRES_DB: training_test
POSTGRES_USER: training
POSTGRES_PASSWORD: training
ports:
- "5433:5432"
tmpfs:
- /var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U training"]
interval: 5s
timeout: 5s
retries: 10
redis-test:
image: redis:7-alpine
ports:
- "6380:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
test:
build:
context: .
args:
REQUIREMENTS_FILE: test.txt
env_file:
- .env
command: >
sh -c "
python manage.py migrate --settings=config.settings.test &&
pytest --cov=. --cov-report=term-missing -v
"
volumes:
- .:/app
environment:
DJANGO_SETTINGS_MODULE: config.settings.test
DATABASE_URL: postgres://training:training@db-test:5432/training_test
REDIS_URL: redis://redis-test:6379/0
DJANGO_SECRET_KEY: test-secret-key-not-for-production
DJANGO_ALLOWED_HOSTS: testserver,localhost
depends_on:
db-test:
condition: service_healthy
redis-test:
condition: service_healthy