-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
153 lines (146 loc) · 5.54 KB
/
Copy pathdocker-compose.yml
File metadata and controls
153 lines (146 loc) · 5.54 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
services:
# ── PIA VPN gateway (only active with: docker compose --profile vpn up) ──────
# Feature flag: set VPN_ENABLED=true in backend/.env AND run with --profile vpn
gluetun:
profiles: [vpn]
image: qmcgaw/gluetun:latest
container_name: streambridge_gluetun
restart: unless-stopped
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun:/dev/net/tun
ports:
- "8888:8888" # HTTP proxy (used by backend when VPN_ENABLED=true)
- "8000:8000" # gluetun control API (used by VPN rotation job)
environment:
VPN_SERVICE_PROVIDER: private internet access
VPN_TYPE: wireguard
# Keep these optional so plain local `docker compose up` works without VPN creds.
# When the `vpn` profile is enabled, provide real values via env or `.env`.
PRIVATE_INTERNET_ACCESS_USER: ${PIA_USERNAME:-}
PRIVATE_INTERNET_ACCESS_PASSWORD: ${PIA_PASSWORD:-}
SERVER_REGIONS: ${PIA_SERVER_REGIONS:-US East}
HTTPPROXY: on
HTTPPROXY_LOG: off
HTTPPROXY_LISTENING_ADDRESS: :8888
HTTP_CONTROL_SERVER_ADDRESS: :8000
HTTP_CONTROL_SERVER_LOG: off
UPDATER_PERIOD: 24h
healthcheck:
test: ["CMD", "/gluetun-entrypoint", "healthcheck"]
interval: 10s
timeout: 5s
retries: 6
start_period: 20s
# ── Redis (required by Twenty CRM's BullMQ workers) ───────────────────────────
redis:
image: redis:7-alpine
container_name: streambridge_redis
restart: unless-stopped
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
# ── Twenty CRM Server ─────────────────────────────────────────────────────────
twenty:
image: twentycrm/twenty:latest
container_name: streambridge_twenty
restart: unless-stopped
ports:
- "3002:3000"
environment:
PORT: 3000
PG_DATABASE_URL: postgresql://postgres:streambridge_dev@postgres:5432/twentycrm
REDIS_URL: redis://redis:6379
SERVER_URL: ${TWENTY_SERVER_URL:-http://localhost:3002}
ACCESS_TOKEN_SECRET: ${TWENTY_ACCESS_TOKEN_SECRET:-changeme-access}
LOGIN_TOKEN_SECRET: ${TWENTY_LOGIN_TOKEN_SECRET:-changeme-login}
REFRESH_TOKEN_SECRET: ${TWENTY_REFRESH_TOKEN_SECRET:-changeme-refresh}
FILE_TOKEN_SECRET: ${TWENTY_FILE_TOKEN_SECRET:-changeme-file}
STORAGE_TYPE: local
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
# ── Twenty CRM Background Worker ──────────────────────────────────────────────
twenty-worker:
image: twentycrm/twenty:latest
container_name: streambridge_twenty_worker
restart: unless-stopped
command: ["yarn", "worker:prod"]
environment:
PG_DATABASE_URL: postgresql://postgres:streambridge_dev@postgres:5432/twentycrm
REDIS_URL: redis://redis:6379
ACCESS_TOKEN_SECRET: ${TWENTY_ACCESS_TOKEN_SECRET:-changeme-access}
LOGIN_TOKEN_SECRET: ${TWENTY_LOGIN_TOKEN_SECRET:-changeme-login}
REFRESH_TOKEN_SECRET: ${TWENTY_REFRESH_TOKEN_SECRET:-changeme-refresh}
FILE_TOKEN_SECRET: ${TWENTY_FILE_TOKEN_SECRET:-changeme-file}
SERVER_URL: ${TWENTY_SERVER_URL:-http://localhost:3002}
depends_on:
- twenty
- redis
postgres:
image: postgres:16-alpine
container_name: streambridge_db
restart: unless-stopped
environment:
POSTGRES_DB: streambridge
POSTGRES_USER: postgres
POSTGRES_PASSWORD: streambridge_dev
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d streambridge"]
interval: 5s
timeout: 5s
retries: 10
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: streambridge_backend
restart: unless-stopped
ports:
- "3001:3001"
env_file:
- ./backend/.env
environment:
DATABASE_URL: postgresql://postgres:streambridge_dev@postgres:5432/streambridge
PORT: 3001
NODE_ENV: production
# Set BASE_URL to your public backend URL (e.g. https://api.yourdomain.com)
BASE_URL: ${BASE_URL:-http://localhost:3001}
# Set FRONTEND_URL to your public frontend URL (e.g. https://yourdomain.com)
FRONTEND_URL: ${FRONTEND_URL:-http://localhost:3000}
# ── VPN feature flag ────────────────────────────────────────────────────
# Set to "true" AND run with --profile vpn to enable PIA VPN routing
VPN_ENABLED: ${VPN_ENABLED:-false}
# Proxy URL (only used when VPN_ENABLED=true; gluetun must be running)
GLOBAL_AGENT_HTTP_PROXY: http://gluetun:8888
GLOBAL_AGENT_NO_PROXY: localhost,127.0.0.1,postgres
GLUETUN_CONTROL_URL: http://gluetun:8000
VPN_ROTATION_HOURS: ${VPN_ROTATION_HOURS:-6}
depends_on:
postgres:
condition: service_healthy
frontend:
build:
context: ./frontend-next
dockerfile: Dockerfile
args:
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-http://localhost:3001}
container_name: streambridge_frontend
restart: unless-stopped
ports:
- "3000:3000"
depends_on:
- backend
volumes:
postgres_data: