Files
full-stack-fastapi-template/compose.override.yml
T
Sebastián Ramírez 5069df32ea ♻️ Use FastAPI entrypoint in Compose (#2420)
## AI Disclaimer

Using Codex with gpt-5.6-sol. Reviewed manually.
2026-08-10 20:01:12 +02:00

110 lines
2.9 KiB
YAML

services:
# Local services are available on their ports, but also available on:
# http://localhost.tiangolo.com: application
# etc. To enable it, update .env, set:
# DOMAIN=localhost.tiangolo.com
proxy:
image: traefik:3.6
ports:
- "80:80"
- "8090:8080"
# Duplicate the command from compose.yml to add --api.insecure=true
command:
# Enable Docker in Traefik, so that it reads labels from Docker services
- --providers.docker
# Do not expose all Docker services, only the ones explicitly exposed
- --providers.docker.exposedbydefault=false
# Create an entrypoint "http" listening on port 80
- --entrypoints.http.address=:80
# Enable the access log, with HTTP requests
- --accesslog
# Enable the Traefik log, for configurations and errors
- --log
# Enable debug logging for local development
- --log.level=DEBUG
# Enable the Dashboard and API
- --api
# Enable the Dashboard and API in insecure mode for local development
- --api.insecure=true
db:
ports:
- "5432:5432"
adminer:
ports:
- "8080:8080"
backend:
ports:
- "8000:8000"
build:
context: .
dockerfile: backend/Dockerfile
# command: sleep infinity # Infinite loop to keep container alive doing nothing
command:
- fastapi
- dev
- --host
- "0.0.0.0"
develop:
watch:
- path: ./backend
action: sync
target: /app/backend
ignore:
- ./backend/.venv
- .venv
- path: ./backend/pyproject.toml
action: rebuild
- path: ./frontend
action: rebuild
ignore:
- ./frontend/node_modules
- ./frontend/dist
- ./frontend/blob-report
- ./frontend/test-results
# TODO: remove once coverage is done locally
volumes:
- ./backend/htmlcov:/app/backend/htmlcov
environment:
ENVIRONMENT: "local"
SMTP_HOST: "mailcatcher"
SMTP_PORT: "1025"
SMTP_TLS: "false"
prestart:
environment:
ENVIRONMENT: "local"
mailcatcher:
image: schickling/mailcatcher
ports:
- "1080:1080"
- "1025:1025"
playwright:
build:
context: .
dockerfile: frontend/Dockerfile.playwright
args:
- NODE_ENV=production
ipc: host
depends_on:
- backend
- mailcatcher
environment:
- FIRST_SUPERUSER=${FIRST_SUPERUSER:?Variable not set}
- FIRST_SUPERUSER_PASSWORD=${FIRST_SUPERUSER_PASSWORD:?Variable not set}
- PLAYWRIGHT_BASE_URL=http://backend:8000
- VITE_API_URL=http://backend:8000
- MAILCATCHER_HOST=http://mailcatcher:1080
# For the reports when run locally
- PLAYWRIGHT_HTML_HOST=0.0.0.0
- CI=${CI:-}
volumes:
- ./frontend/blob-report:/app/frontend/blob-report
- ./frontend/test-results:/app/frontend/test-results
ports:
- 9323:9323