-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
66 lines (61 loc) · 1.65 KB
/
docker-compose.prod.yml
File metadata and controls
66 lines (61 loc) · 1.65 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
66
# TissuePlex — production docker-compose
#
# Differences from docker-compose.yml:
# - Caddy service added: handles HTTPS and automatic TLS certificates
# - frontend and backend ports are NOT exposed to the host directly;
# all external traffic goes through Caddy on ports 80/443
#
# Usage (on the server, after running deploy.sh):
# DATA_PATH=/mnt/tissuplex-data docker compose -f docker-compose.prod.yml up -d --build
#
# Or with an env file:
# docker compose -f docker-compose.prod.yml --env-file .env.prod up -d --build
services:
caddy:
image: caddy:2-alpine
ports:
- "80:80"
- "443:443"
- "443:443/udp"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data
- caddy_config:/config
depends_on:
- frontend
restart: unless-stopped
backend:
build:
context: ./backend
dockerfile: Dockerfile
volumes:
- ${DATA_PATH:-./sample_data}:/data:ro
- dzi_cache:/cache
environment:
DATA_ROOT: /data
CACHE_DIR: /cache
DUCKDB_MEMORY_LIMIT: ${DUCKDB_MEMORY_LIMIT:-8GB}
restart: unless-stopped
stop_grace_period: 5m
deploy:
resources:
limits:
memory: ${BACKEND_MEMORY_LIMIT:-12g}
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
depends_on:
backend:
condition: service_healthy
restart: unless-stopped
volumes:
dzi_cache:
caddy_data:
caddy_config: