Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
99 lines (94 loc) · 2.3 KB
/
Copy pathdocker-compose.yml
File metadata and controls
99 lines (94 loc) · 2.3 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
services:
# ── Cloudflare Tunnel (handles TLS, DDoS, WAF at the edge) ──
# Setup: https://one.dash.cloudflare.com → Networks → Tunnels → Create
# Copy the tunnel token to .env as CLOUDFLARE_TUNNEL_TOKEN
cloudflared:
image: cloudflare/cloudflared:latest
command: tunnel run --token ${CLOUDFLARE_TUNNEL_TOKEN}
restart: unless-stopped
depends_on:
- app
deploy:
resources:
limits:
cpus: '0.25'
memory: 64M
app:
build: .
dns:
- 8.8.8.8
- 1.1.1.1
ports:
- "127.0.0.1:8080:8080"
env_file: .env
environment:
DATABASE_URL: postgres://copilot:copilot@db:5432/copilot?sslmode=disable
REDIS_URL: redis://:copilot-redis@redis:6379
EMBEDDING_ADDR: embedding:50051
DEV_MODE: "false"
CORS_ORIGIN: "${CORS_ORIGIN:-https://your-domain.com}"
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
volumes:
- ./data/repos:/data/repos
- ./web/dist:/app/web/dist
restart: unless-stopped
deploy:
resources:
limits:
cpus: '2'
memory: 512M
db:
image: pgvector/pgvector:pg16
environment:
POSTGRES_USER: copilot
POSTGRES_PASSWORD: copilot
POSTGRES_DB: copilot
ports:
- "127.0.0.1:5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U copilot"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
deploy:
resources:
limits:
cpus: '1'
memory: 512M
redis:
image: redis:7-alpine
command: redis-server --requirepass copilot-redis --maxmemory 256mb --maxmemory-policy allkeys-lru
ports:
- "127.0.0.1:6379:6379"
restart: unless-stopped
deploy:
resources:
limits:
cpus: '0.25'
memory: 256M
embedding:
build:
context: .
dockerfile: python-embedding/Dockerfile.cpu
ports:
- "127.0.0.1:50051:50051"
environment:
MODELSCOPE_CACHE: /modelscope-cache
volumes:
- modelscope_data:/modelscope-cache
restart: unless-stopped
deploy:
resources:
limits:
cpus: '2'
memory: 2G
volumes:
pgdata:
modelscope_data: