-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
65 lines (62 loc) · 2.62 KB
/
Copy pathdocker-compose.yml
File metadata and controls
65 lines (62 loc) · 2.62 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
58
59
60
61
62
63
64
65
# Docker Compose setup for OCR Engine.
#
# Values come from a root .env file (copy .env.example to .env).
#
# Two variables are mandatory - DJANGO_SECRET_KEY and MISTRAL_API_KEY. Both use
# the `:?` form so a missing value fails immediately with an explanation, rather
# than starting the stack on a shared default or a service that cannot work.
# Everything else has a working default.
#
# Note there is deliberately no `env_file:` key: it would point at .env files
# that are gitignored and therefore missing on a fresh clone, which makes
# Compose fail outright.
services:
backend:
build:
context: ./backend
environment:
# Compose runs the production server; DEBUG stays off unless asked for.
DJANGO_DEBUG: ${DJANGO_DEBUG:-False}
DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY:?set DJANGO_SECRET_KEY in .env - see .env.example}
DJANGO_ALLOWED_HOSTS: ${DJANGO_ALLOWED_HOSTS:-localhost,127.0.0.1,backend}
DJANGO_CORS_ALLOWED_ORIGINS: ${DJANGO_CORS_ALLOWED_ORIGINS:-http://localhost:5173}
DJANGO_CSRF_TRUSTED_ORIGINS: ${DJANGO_CSRF_TRUSTED_ORIGINS:-http://localhost:5173}
# TLS is terminated outside this compose file, so no in-container redirect.
DJANGO_SECURE_SSL_REDIRECT: ${DJANGO_SECURE_SSL_REDIRECT:-False}
DJANGO_SECURE_HSTS_SECONDS: ${DJANGO_SECURE_HSTS_SECONDS:-0}
DJANGO_LOG_LEVEL: ${DJANGO_LOG_LEVEL:-INFO}
MISTRAL_API_KEY: ${MISTRAL_API_KEY:?set MISTRAL_API_KEY in .env - see .env.example}
MISTRAL_OCR_MODEL: ${MISTRAL_OCR_MODEL:-mistral-ocr-latest}
RECAPTCHA_SECRET_KEY: ${RECAPTCHA_SECRET_KEY:-}
MAX_UPLOAD_SIZE: ${MAX_UPLOAD_SIZE:-209715200}
MAX_ARCHIVE_EXTRACTED_SIZE: ${MAX_ARCHIVE_EXTRACTED_SIZE:-524288000}
# Left empty on purpose: SQLite needs no database server.
DB_ENGINE: ${DB_ENGINE:-}
DB_NAME: ${DB_NAME:-}
DB_USER: ${DB_USER:-}
DB_PASSWORD: ${DB_PASSWORD:-}
DB_HOST: ${DB_HOST:-}
DB_PORT: ${DB_PORT:-}
# Keep the database and uploads on the mounted volume, not in the image.
SQLITE_PATH: /app/data/db.sqlite3
MEDIA_ROOT: /app/data/media
volumes:
# Persist the SQLite database and uploaded media across restarts.
- backend-data:/app/data
ports:
- "8000:8000"
restart: unless-stopped
frontend:
build:
context: ./frontend
args:
# Vite inlines these at build time, so they are build args, not env vars.
VITE_API_URL: ${VITE_API_URL:-http://localhost:8000}
VITE_RECAPTCHA_SITE_KEY: ${VITE_RECAPTCHA_SITE_KEY:-}
ports:
- "5173:8080"
depends_on:
- backend
restart: unless-stopped
volumes:
backend-data: