Files
papercrate/docker-compose.test.yml
nils be451bda1e
ci / docker (backend, backend/Dockerfile, backend) (push) Failing after 14s
ci / docker (frontend, frontend/Dockerfile, frontend) (push) Failing after 13s
dev: switch to fully containerized Docker Compose workflow
- Replace tmux setup with a full Docker Compose development stack
- Update backend Dockerfile to use `cargo-chef` caching and `supervisord`
- Containerize frontend development server
- Update tests to run in isolated containers
- Remove legacy `papercrate.tmux`
2025-12-17 19:55:47 +01:00

64 lines
1.6 KiB
YAML

services:
postgres-test:
image: postgres:16-alpine
environment:
POSTGRES_USER: papercrate
POSTGRES_PASSWORD: papercrate_test
POSTGRES_DB: papercrate_test
ports:
- "5433:5432"
tmpfs:
- /var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U papercrate -d papercrate_test"]
interval: 5s
timeout: 5s
retries: 5
quickwit-test:
image: quickwit/quickwit:0.8.2
command: ["run"]
environment:
QW_ENABLE_API_AUTH: "false"
QW_DATA_DIR: /quickwit/data
ports:
- "7281:7280"
volumes:
- quickwit_test_data:/quickwit/data
healthcheck:
test: ["CMD", "curl", "-sf", "http://127.0.0.1:7280/api/v1/version"]
interval: 10s
timeout: 5s
retries: 5
test-runner:
build:
context: ./backend
dockerfile: Dockerfile
target: development
depends_on:
postgres-test:
condition: service_healthy
quickwit-test:
condition: service_healthy
volumes:
- ./backend:/app
- /app/target
environment:
TEST_DATABASE_URL: postgres://papercrate:papercrate_test@postgres-test:5432/papercrate_test
DATABASE_MAX_POOL_SIZE: 1
S3_BUCKET: documents
JWT_SECRET: change-me-super-secret
QUICKWIT_ENDPOINT: http://quickwit-test:7280
RUST_LOG: info
command: >
/bin/bash -c "
echo 'Waiting for Postgres...' &&
until pg_isready -h postgres-test -U papercrate; do sleep 1; done &&
echo 'Running tests...' &&
cargo test
"
volumes:
quickwit_test_data: