-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
78 lines (76 loc) · 1.92 KB
/
docker-compose.yml
File metadata and controls
78 lines (76 loc) · 1.92 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
# ================================================
# Sales Insight Automator — Full Local Stack
# ================================================
# Usage: docker-compose up --build
# Docs: http://localhost:8000/docs
# App: http://localhost:3000
# ================================================
services:
# ---------- Backend API ----------
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: sia-backend
ports:
- "${BACKEND_PORT:-8000}:8000"
env_file:
- .env
environment:
- ALLOWED_ORIGINS=http://localhost:3000,http://localhost:${FRONTEND_PORT:-3000}
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
restart: unless-stopped
read_only: true
tmpfs:
- /tmp
- /app/app/__pycache__
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
deploy:
resources:
limits:
memory: 512M
# ---------- Frontend SPA ----------
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
VITE_API_URL: http://localhost:${BACKEND_PORT:-8000}
VITE_API_KEY: ${API_KEY:-change-me-to-a-strong-random-string}
container_name: sia-frontend
ports:
- "${FRONTEND_PORT:-3000}:80"
depends_on:
backend:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost/"]
interval: 30s
timeout: 5s
retries: 3
start_period: 5s
restart: unless-stopped
read_only: true
tmpfs:
- /tmp
- /var/cache/nginx
- /var/run
- /var/log/nginx
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
cap_add:
- NET_BIND_SERVICE
deploy:
resources:
limits:
memory: 128M