forked from TheSmallHanCat/flow2api
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.headed.yml
More file actions
108 lines (102 loc) · 3.53 KB
/
Copy pathdocker-compose.headed.yml
File metadata and controls
108 lines (102 loc) · 3.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
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
100
101
102
103
104
105
106
107
108
# In-container headed browser (VNC optional) + agent gateway + Cloudflare Tunnel.
# docker compose -f docker-compose.headed.yml up -d --build
# In Zero Trust, point admin-flow and flow-api hostnames to http://flow2api-headed:8000
# Optional agent hostname can point to http://agent-gateway:9080 (for /ws/agents).
services:
flow2api-headed:
init: true
env_file:
- .env
build:
context: .
dockerfile: Dockerfile.headed
args:
VITE_NOVNC_URL: ${VITE_NOVNC_URL:-}
image: flow2api:headed
container_name: flow2api-headed
ports:
- "${FRONTEND_PORT:-8000}:8000"
- "${VNC_HOST_PORT:-5900}:${VNC_PORT:-5900}"
- "${NOVNC_HOST_PORT:-6080}:${NOVNC_PORT:-6080}"
volumes:
- ./data:/app/data
- ./tmp:/app/tmp
- ./config/setting.toml:/app/config/setting.toml
environment:
- PYTHONUNBUFFERED=1
- ALLOW_DOCKER_HEADED_CAPTCHA=true
- DISPLAY=:99
- XVFB_SCREEN=${XVFB_SCREEN:-1920x1080x24}
- ENABLE_HEADED_VNC=${ENABLE_HEADED_VNC:-true}
- ENABLE_HEADED_NOVNC=${ENABLE_HEADED_NOVNC:-true}
- VNC_PORT=${VNC_PORT:-5900}
- NOVNC_PORT=${NOVNC_PORT:-6080}
- VNC_PASSWORD=${VNC_PASSWORD:-}
- FLOW2API_API_ONLY_HOST=${FLOW2API_API_ONLY_HOST:-flow-api.prismacreative.online}
- FLOW2API_DB_URL=${FLOW2API_DB_URL:-postgresql://flow2api:flow2api@postgres:5432/flow2api}
- FLOW2API_REDIS_URL=${FLOW2API_REDIS_URL:-redis://redis:6379/0}
shm_size: ${SHM_SIZE:-2gb}
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
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}
- GATEWAY_AGENT_AUTH_MODE=${GATEWAY_AGENT_AUTH_MODE:-keygen}
- KEYGEN_VERIFY_MODE=${KEYGEN_VERIFY_MODE:-introspection}
- KEYGEN_API_URL=${KEYGEN_API_URL:-https://api.keygen.sh}
- KEYGEN_ACCOUNT=${KEYGEN_ACCOUNT:-}
- KEYGEN_PUBLIC_KEY=${KEYGEN_PUBLIC_KEY}
- KEYGEN_API_TOKEN=${KEYGEN_API_TOKEN:-}
- 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
command: ["redis-server", "--appendonly", "yes"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
postgres:
image: postgres:16-alpine
container_name: flow2api-headed-postgres
environment:
- POSTGRES_USER=${POSTGRES_USER:-flow2api}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-flow2api}
- POSTGRES_DB=${POSTGRES_DB:-flow2api}
volumes:
- flow2api-headed-postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-flow2api} -d ${POSTGRES_DB:-flow2api}"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
cloudflared:
image: cloudflare/cloudflared:latest
container_name: flow2api-headed-cloudflared
command: tunnel run
environment:
TUNNEL_TOKEN: ${TUNNEL_TOKEN}
depends_on:
- flow2api-headed
- agent-gateway
restart: unless-stopped
volumes:
flow2api-headed-postgres-data: