-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathdocker-compose.release.yaml
More file actions
212 lines (202 loc) · 7.49 KB
/
Copy pathdocker-compose.release.yaml
File metadata and controls
212 lines (202 loc) · 7.49 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# Preloop Docker Compose - Release Configuration
# Use this file for production-like deployments with tagged images.
#
# Usage:
# PRELOOP_VERSION=0.8.0 SECRET_KEY=$(openssl rand -hex 32) \
# docker compose -f docker-compose.release.yaml up -d
#
# Required environment variables (set in .env or export before running):
# PRELOOP_VERSION - Image tag (e.g., 0.8.0, latest)
# SECRET_KEY - Secret key for JWT token signing (generate with: openssl rand -hex 32)
#
# Optional environment variables:
# POSTGRES_PASSWORD - Database password (default: postgres)
# LOG_LEVEL - Logging level (default: INFO)
services:
postgres:
image: pgvector/pgvector:pg16
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: preloop
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 10s
timeout: 5s
retries: 5
nats:
image: nats:alpine
restart: unless-stopped
command: [ "-js", "-m", "8222" ]
healthcheck:
test: [ "CMD-SHELL", "wget -q --spider http://127.0.0.1:8222/healthz" ]
interval: 10s
timeout: 5s
retries: 5
migrate:
image: ghcr.io/preloop/preloop:${PRELOOP_VERSION:-latest}
restart: "no"
depends_on:
postgres:
condition: service_healthy
environment:
DATABASE_URL: postgresql+psycopg://postgres:${POSTGRES_PASSWORD:-postgres}@postgres/preloop
SECRET_KEY: ${SECRET_KEY:?SECRET_KEY is required}
LOG_LEVEL: ${LOG_LEVEL:-INFO}
command: python scripts/init_db.py --force
api:
image: ghcr.io/preloop/preloop:${PRELOOP_VERSION:-latest}
restart: unless-stopped
depends_on:
migrate:
condition: service_completed_successfully
postgres:
condition: service_healthy
nats:
condition: service_healthy
environment:
DATABASE_URL: postgresql+psycopg://postgres:${POSTGRES_PASSWORD:-postgres}@postgres/preloop
NATS_URL: nats://nats:4222
HOST: 0.0.0.0
PORT: 8000
SECRET_KEY: ${SECRET_KEY:?SECRET_KEY is required}
JWT_ALGORITHM: HS256
ACCESS_TOKEN_EXPIRE_MINUTES: 60
LOG_LEVEL: ${LOG_LEVEL:-INFO}
PRELOOP_SERVICE_ROLE: api
# Public origin this instance is reached at. Used for approval links,
# QR pairing and CORS. Set by scripts/install-oss.sh (PRELOOP_URL).
PRELOOP_URL: ${PRELOOP_URL:-http://localhost:3000}
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-*}
# Public signup. Set false to close registration (invite-only); the
# install script does this once the first user exists.
REGISTRATION_ENABLED: ${REGISTRATION_ENABLED:-true}
# Opt out of adoption telemetry (the daily version check-in to
# preloop.ai). Test/CI installs must always set this to true.
PRELOOP_DISABLE_TELEMETRY: ${PRELOOP_DISABLE_TELEMETRY:-}
FLOW_EXECUTION_WORKER_ENABLED: ${FLOW_EXECUTION_WORKER_ENABLED:-false}
# SMTP — required for approval emails, invitations and password resets.
# Configure interactively via scripts/install-oss.sh or edit .env.
SMTP_HOST: ${SMTP_HOST:-}
SMTP_PORT: ${SMTP_PORT:-587}
SMTP_USERNAME: ${SMTP_USERNAME:-}
SMTP_PASSWORD: ${SMTP_PASSWORD:-}
SMTP_FROM: ${SMTP_FROM:-}
SMTP_FROM_NAME: ${SMTP_FROM_NAME:-Preloop}
ports:
- "8000:8000"
command: python -m preloop.server
gateway:
image: ghcr.io/preloop/preloop:${PRELOOP_VERSION:-latest}
restart: unless-stopped
depends_on:
migrate:
condition: service_completed_successfully
postgres:
condition: service_healthy
nats:
condition: service_healthy
environment:
DATABASE_URL: postgresql+psycopg://postgres:${POSTGRES_PASSWORD:-postgres}@postgres/preloop
NATS_URL: nats://nats:4222
HOST: 0.0.0.0
PORT: 8000
SECRET_KEY: ${SECRET_KEY:?SECRET_KEY is required}
JWT_ALGORITHM: HS256
ACCESS_TOKEN_EXPIRE_MINUTES: 60
LOG_LEVEL: ${LOG_LEVEL:-INFO}
PRELOOP_SERVICE_ROLE: gateway
PRELOOP_URL: ${PRELOOP_URL:-http://localhost:3000}
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-*}
ports:
- "8001:8000"
command: python -m preloop.server
scheduler:
image: ghcr.io/preloop/preloop:${PRELOOP_VERSION:-latest}
restart: unless-stopped
depends_on:
migrate:
condition: service_completed_successfully
postgres:
condition: service_healthy
nats:
condition: service_healthy
environment:
DATABASE_URL: postgresql+psycopg://postgres:${POSTGRES_PASSWORD:-postgres}@postgres/preloop
NATS_URL: nats://nats:4222
SECRET_KEY: ${SECRET_KEY:?SECRET_KEY is required}
JWT_ALGORITHM: HS256
ACCESS_TOKEN_EXPIRE_MINUTES: 60
LOG_LEVEL: ${LOG_LEVEL:-INFO}
command: preloop-sync scheduler
worker:
image: ghcr.io/preloop/preloop:${PRELOOP_VERSION:-latest}
restart: unless-stopped
depends_on:
migrate:
condition: service_completed_successfully
postgres:
condition: service_healthy
nats:
condition: service_healthy
environment:
DATABASE_URL: postgresql+psycopg://postgres:${POSTGRES_PASSWORD:-postgres}@postgres/preloop
NATS_URL: nats://nats:4222
SECRET_KEY: ${SECRET_KEY:?SECRET_KEY is required}
JWT_ALGORITHM: HS256
ACCESS_TOKEN_EXPIRE_MINUTES: 60
LOG_LEVEL: ${LOG_LEVEL:-INFO}
FLOW_EXECUTION_WORKER_ENABLED: ${FLOW_EXECUTION_WORKER_ENABLED:-false}
PRELOOP_URL: ${PRELOOP_URL:-http://localhost:3000}
# SMTP — required for approval emails, invitations and password resets.
# Configure interactively via scripts/install-oss.sh or edit .env.
SMTP_HOST: ${SMTP_HOST:-}
SMTP_PORT: ${SMTP_PORT:-587}
SMTP_USERNAME: ${SMTP_USERNAME:-}
SMTP_PASSWORD: ${SMTP_PASSWORD:-}
SMTP_FROM: ${SMTP_FROM:-}
SMTP_FROM_NAME: ${SMTP_FROM_NAME:-Preloop}
# The dedicated flow-worker below filters execute_flow /
# resume_flow_execution off the WORKQUEUE stream; consumer filters must
# not overlap, so this pool enumerates everything else instead of using
# the `preloop.sync.tasks.*` wildcard.
command: preloop-sync worker --exclude-tasks execute_flow,resume_flow_execution
flow-worker:
image: ghcr.io/preloop/preloop:${PRELOOP_VERSION:-latest}
restart: unless-stopped
depends_on:
migrate:
condition: service_completed_successfully
postgres:
condition: service_healthy
nats:
condition: service_healthy
environment:
DATABASE_URL: postgresql+psycopg://postgres:${POSTGRES_PASSWORD:-postgres}@postgres/preloop
NATS_URL: nats://nats:4222
SECRET_KEY: ${SECRET_KEY:?SECRET_KEY is required}
JWT_ALGORITHM: HS256
ACCESS_TOKEN_EXPIRE_MINUTES: 60
LOG_LEVEL: ${LOG_LEVEL:-INFO}
FLOW_EXECUTION_WORKER_ENABLED: ${FLOW_EXECUTION_WORKER_ENABLED:-true}
HOSTNAME: flow-worker
command: ["preloop-sync", "worker", "--tasks", "execute_flow,resume_flow_execution"]
console:
image: ghcr.io/preloop/console:${PRELOOP_VERSION:-latest}
restart: unless-stopped
depends_on:
- api
- gateway
ports:
- "3000:80"
environment:
# Without API_URL the image falls back to http://localhost:8000, which
# inside this container is the console itself — every /api call 502s and
# nobody can even log in.
API_URL: http://api:8000
GATEWAY_URL: http://gateway:8000
volumes:
postgres-data: