-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
51 lines (48 loc) · 1.58 KB
/
Copy pathdocker-compose.yml
File metadata and controls
51 lines (48 loc) · 1.58 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
# One command for the whole system: docker compose up --build
# frontend -> http://localhost:8080
# backend -> http://localhost:8000 (Swagger at /docs)
#
# The browser talks to the backend directly on the published :8000 port
# (VITE_API_URL is baked into the frontend build below), so the backend's
# CORS allowlist must name the frontend's origin -- that's what
# FRONTEND_BASE_URL here is for.
services:
redis:
image: redis:7-alpine
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 5
backend:
build: ./backend
ports:
- "8000:8000"
environment:
# Persistent SQLite on the named volume below; the image-internal
# default would be wiped with the container.
DATABASE_URL: sqlite:////data/app.db
REDIS_URL: redis://redis:6379/0
FRONTEND_BASE_URL: http://localhost:8080
# This compose file is the local development stack, and the READMEs
# point at Swagger here. The image default is off -- see
# ENABLE_API_DOCS in backend/.env.example.
ENABLE_API_DOCS: "true"
# Real deployments must set a real value (see DEPLOYMENT.md); the
# app logs a loud warning on the default.
SECRET_KEY: ${SECRET_KEY:-change-this-for-development}
volumes:
- lingua-data:/data
depends_on:
- redis # startup order only; the cache degrades gracefully if Redis is down
frontend:
build:
context: ./frontend
args:
VITE_API_URL: http://localhost:8000
ports:
- "8080:80"
depends_on:
- backend
volumes:
lingua-data: