Files
crr-shifts/docker-compose.dev.yml
T

41 lines
1.2 KiB
YAML

# Development stack: code is bind-mounted, reload is on, no restart policy.
# Run standalone: docker compose -f docker-compose.dev.yml up --build
# Checks: make check
services:
app:
build:
context: .
target: dev
env_file:
- path: .env
required: false
ports:
- "${PORT:-8000}:8000"
volumes:
- ./app:/app/app
- ./tests:/app/tests
- ./migrations:/app/migrations
- ./alembic.ini:/app/alembic.ini:ro
- ${DATA_DIR:-./data}:/app/data
command: ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload", "--reload-dir", "app", "--reload-dir", "migrations"]
checks:
build:
context: .
target: dev
profiles:
- check
environment:
SECRET_KEY: test-only-secret-key
DATABASE_URL: sqlite:///./data/test.db
INITIAL_ADMIN_PASSWORD: test-only-password
SMTP_HOST: ""
PYTHONPATH: /app
volumes:
- ./app:/app/app
- ./tests:/app/tests
- ./pyproject.toml:/app/pyproject.toml:ro
- ./migrations:/app/migrations:ro
- ./alembic.ini:/app/alembic.ini:ro
command: ["sh", "-c", "python -m compileall -q app && pytest -ra"]