forked from TheSmallHanCat/flow2api
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.agent.yml
More file actions
44 lines (41 loc) · 1.53 KB
/
Copy pathdocker-compose.agent.yml
File metadata and controls
44 lines (41 loc) · 1.53 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
# Agent gateway + Redis + Cloudflare Tunnel (same connector TUNNEL_TOKEN as the rest of your stack).
# Merge with docker-compose.yml so `flow2api` exists on the same network:
# docker compose -f docker-compose.yml -f docker-compose.agent.yml up -d --build
#
# .env: TUNNEL_TOKEN (see .env.example), optional GATEWAY_*.
#
# Cloudflare Zero Trust → Tunnels → Public hostnames (same tunnel as admin-flow / flow-api), add e.g.:
# - https://agents.yourdomain.com → http://agent-gateway:9080 (WSS: /ws/agents)
# flow-api + admin-flow still point to http://flow2api:8000
#
# Captcha: admin → remote_browser_base_url = http://agent-gateway:9080, key = GATEWAY_FLOW2API_BEARER
services:
agent-gateway:
build:
context: .
dockerfile: Dockerfile.agent-gateway
container_name: agent-gateway
ports:
- "9080:9080"
environment:
GATEWAY_FLOW2API_BEARER: ${GATEWAY_FLOW2API_BEARER:-change-me-match-flow2api}
GATEWAY_AGENT_DEVICE_TOKEN: ${GATEWAY_AGENT_DEVICE_TOKEN:-change-me-device-secret}
SOLVE_TIMEOUT_SECONDS: ${SOLVE_TIMEOUT_SECONDS:-120}
REDIS_URL: ${REDIS_URL:-redis://redis:6379/0}
depends_on:
- redis
restart: unless-stopped
redis:
image: redis:7-alpine
container_name: agent-gateway-redis
restart: unless-stopped
cloudflared:
image: cloudflare/cloudflared:latest
container_name: flow2api-cloudflared
command: tunnel run
environment:
TUNNEL_TOKEN: ${TUNNEL_TOKEN}
depends_on:
- flow2api
- agent-gateway
restart: unless-stopped