-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
33 lines (31 loc) · 1013 Bytes
/
docker-compose.yml
File metadata and controls
33 lines (31 loc) · 1013 Bytes
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
version: "3.8"
services:
playwright:
build:
context: .
# 使用传统 Docker 构建(兼容旧版本,不依赖 buildx)
# Docker 层缓存仍然有效:只改 src/ 时不会重新下载依赖
container_name: playwright-dynamic
ports:
- "3000:3000"
environment:
- API_TOKEN=${API_TOKEN:-mindtalk-secret-2026}
- CF_ACCOUNT_ID=${CF_ACCOUNT_ID}
- CF_WORKERS_AI_TOKEN=${CF_WORKERS_AI_TOKEN}
restart: always
shm_size: "2gb"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 10s
retries: 3
tunnel:
image: cloudflare/cloudflared:latest
container_name: cf-tunnel
restart: always
# 共享 playwright 的网络命名空间,这样就能通过 localhost:3000 访问
network_mode: service:playwright
depends_on:
- playwright
# 使用环境变量来传递 Token,更安全
command: tunnel --no-autoupdate run --token ${CF_TUNNEL_TOKEN}