-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
80 lines (76 loc) · 1.73 KB
/
docker-compose.yml
File metadata and controls
80 lines (76 loc) · 1.73 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
services:
backend:
build:
context: .
dockerfile: backend/Dockerfile
env_file:
- .env
command: >
sh -lc 'uv run main.py'
expose:
- "8000"
environment:
- ENVIRONMENT=${ENVIRONMENT:-production}
- HF_HOME=/cache/hf
volumes:
- hf_cache:/cache/hf
healthcheck:
test: ["CMD", "python3", "-c", "import urllib.request,sys; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=2).read(); sys.exit(0)"]
interval: 10s
timeout: 3s
retries: 5
start_period: 30s
networks: [appnet]
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
depends_on:
backend:
condition: service_healthy
# no host ports; Caddy will proxy to this container
expose:
- "80"
volumes:
- ./frontend/nginx.conf:/etc/nginx/conf.d/default.conf:ro
networks: [appnet]
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
caddy:
image: caddy:2
depends_on:
- frontend
ports:
- "80:80"
- "443:443"
environment:
# change to an email you control for Let's Encrypt notifications
- ACME_AGREE=true
- EMAIL=${ACME_EMAIL:-swastik.r.900@gmail.com}
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data
- caddy_config:/config
networks: [appnet]
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
appnet:
volumes:
hf_cache:
caddy_data:
caddy_config: