forked from TheSmallHanCat/flow2api
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
75 lines (70 loc) · 2.37 KB
/
Copy pathdocker-compose.yml
File metadata and controls
75 lines (70 loc) · 2.37 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
# Flow2API app only. For Cloudflare Tunnel + agent gateway, merge:
# docker compose -f docker-compose.yml -f docker-compose.agent.yml up -d
#
# Headed: docker compose -f docker-compose.headed.yml up -d
# Local + frontend: docker compose -f docker-compose.local.yml up -d
# WARP: docker compose -f docker-compose.proxy.yml up -d
#
# flow2api is built from this repo (Vite `frontend/` → `/app/static`). Prebuilt
# `ghcr.io/.../flow2api:latest` is often the older static admin; use the build below for the current UI.
# To force upstream image only: remove `build:` and set `image: ghcr.io/thesmallhancat/flow2api:latest`.
services:
flow2api:
build:
context: .
dockerfile: Dockerfile
image: flow2api:local
container_name: flow2api
ports:
- "38000:8000"
volumes:
- ./data:/app/data
- ./tmp:/app/tmp
- ./config/setting.toml:/app/config/setting.toml
environment:
- PYTHONUNBUFFERED=1
- 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}
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
postgres:
image: postgres:16-alpine
container_name: flow2api-postgres
environment:
- POSTGRES_USER=${POSTGRES_USER:-flow2api}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-flow2api}
- POSTGRES_DB=${POSTGRES_DB:-flow2api}
volumes:
- flow2api-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
redis:
image: redis:7-alpine
container_name: flow2api-redis
command: ["redis-server", "--appendonly", "yes"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
cloudflared:
image: cloudflare/cloudflared:latest
container_name: flow2api-cloudflared
command: tunnel run
environment:
TUNNEL_TOKEN: ${TUNNEL_TOKEN}
depends_on:
- flow2api
restart: unless-stopped
volumes:
flow2api-postgres-data: