-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
57 lines (54 loc) · 2.03 KB
/
Copy pathdocker-compose.yml
File metadata and controls
57 lines (54 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Requires Docker Compose v2.24+ (for `env_file: required: false`).
#
# Runs with zero configuration: the backend defaults to SQLite and the stack
# starts without any .env present. Copy backend/.env.example to backend/.env
# and add API keys to enable recognition; without them the API answers 503.
services:
backend:
build:
context: ./backend
# Optional so a fresh clone starts before any .env is created. The previous
# compose file made these mandatory, which broke `docker compose up` on a
# fresh clone because .env is gitignored.
env_file:
- path: ./backend/.env
required: false
environment:
# Compose-local defaults; anything in backend/.env overrides these.
DEBUG: ${DEBUG:-False}
DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY:-compose-dev-secret-change-me-before-deploying}
DJANGO_ALLOWED_HOSTS: ${DJANGO_ALLOWED_HOSTS:-localhost,127.0.0.1,backend}
CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS:-http://localhost:5173}
# Terminating TLS is the deployment's job, not this local stack's.
SECURE_SSL_REDIRECT: "False"
ports:
- "8000:8000"
volumes:
# Keeps the SQLite database and CSV export across container restarts.
- backend-data:/app/CSV
healthcheck:
test:
- CMD
- python
- -c
- import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8000/healthz/', timeout=4).status==200 else 1)
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
frontend:
build:
context: ./frontend
args:
# Vite inlines these at build time, so they are build args, not runtime
# environment. Rebuild after changing them.
VITE_API_URL: ${VITE_API_URL:-http://localhost:8000/recognition}
VITE_RECAPTCHA_SITE_KEY: ${VITE_RECAPTCHA_SITE_KEY:-}
ports:
# Host 5173 keeps the familiar dev URL; nginx serves on 8080 in-container.
- "5173:8080"
depends_on:
backend:
condition: service_started
volumes:
backend-data: