-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
316 lines (302 loc) · 10.9 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
316 lines (302 loc) · 10.9 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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
# Roomote Coolify template definition.
#
# This file is the maintained source of truth for running Roomote as a
# Coolify Docker Compose resource. Paste its contents into a new
# "Docker Compose Empty" resource in Coolify (see README.md for the full
# walkthrough). `${SERVICE_*}` values use Coolify's magic environment
# variables and are generated or resolved by Coolify at deploy time.
#
# Design notes:
# - Web, api, bullmq, and the db-migrate one-shot use the non-root
# compatibility image. The controller uses its dedicated non-root image,
# which is the only control-plane image containing the Docker CLI.
# - Coolify's proxy is the HTTPS edge. There is no bundled Caddy and no
# `/_roomote-api` path routing: web, api, and minio each get their own
# public domain through `SERVICE_FQDN_*` declarations, and `TRPC_URL`
# points at the api origin directly.
# - Coolify magic variables with the same name resolve to the same value
# across every service in this resource, so shared secrets such as
# `SERVICE_PASSWORD_MINIO` are safe to reference in more than one place
# (unlike Railway's per-occurrence `secret()` template function).
# - The Coolify host has a Docker socket, so the `docker` sandbox provider
# works and is the template default. Only a restricted internal proxy mounts
# the raw socket; the controller reaches its allowed API sections over the
# docker-api network. Hosted sandboxes (modal/e2b/daytona) are a config-only
# swap; see "Task execution" in README.md.
# - No openssl provisioning step. `R_AUTO_GENERATE_KEYS=true` makes
# Roomote generate the `JOB_AUTH_*`/`PREVIEW_AUTH_*` P-256 keypairs at
# first boot and persist them encrypted (with `ENCRYPTION_KEY`) in
# Postgres.
# - The template tracks the mutable `:develop` image alias and contains no
# version strings. The images bake RELEASE_VERSION; the app derives
# `DOCKER_WORKER_IMAGE` from it, and the controller reads the worker
# release version from the VERSION file inside `worker-current.tar.gz`.
# Production deployments can pin an immutable `v*` tag in the
# `x-roomote-app-image` anchor.
# - `SETUP_TOKEN` is generated by default because Coolify domains are
# publicly reachable. Copy it from the resource's environment variables
# panel to open `/setup`.
# - Live previews stay disabled by default. They need a wildcard domain
# routed to the optional preview-proxy service; see README.md.
x-roomote-app-image: &roomote-app-image ghcr.io/roocodeinc/roomote-app:develop
# Shared by every app service. Coolify resolves the same magic variable to
# the same generated value in each service of this resource.
x-roomote-shared-env: &roomote-shared-env
R_APP_ENV: production
ROOMOTE_DOCKER_LOAD_ENV_FILE: 'false'
R_AUTO_GENERATE_KEYS: 'true'
ENCRYPTION_KEY: ${SERVICE_BASE64_64_ENCRYPTIONKEY}
ARTIFACT_SIGNING_KEY: ${SERVICE_BASE64_64_ARTIFACTSIGNING}
DASHBOARD_PASSWORD: ${SERVICE_PASSWORD_DASHBOARD}
SETUP_TOKEN: ${SERVICE_PASSWORD_SETUPTOKEN}
S3_ACCESS_KEY_ID: roomote
S3_SECRET_ACCESS_KEY: ${SERVICE_PASSWORD_MINIO}
S3_REGION: us-east-1
S3_BUCKET_ARTIFACTS: roomote-artifacts
S3_AUTO_CREATE_BUCKET: 'true' # api creates the MinIO bucket at boot
DEFAULT_COMPUTE_PROVIDER: docker
DATABASE_URL: postgres://postgres:${SERVICE_PASSWORD_POSTGRES}@postgres:5432/roomote
REDIS_URL: redis://redis:6379
R_APP_URL: ${SERVICE_URL_WEB}
R_PUBLIC_URL: ${SERVICE_URL_WEB}
TRPC_URL: ${SERVICE_URL_API}
S3_ENDPOINT: http://minio:9000
S3_PRESIGN_ENDPOINT: ${SERVICE_URL_MINIO}
services:
postgres:
image: postgres:17.5@sha256:aadf2c0696f5ef357aa7a68da995137f0cf17bad0bf6e1f17de06ae5c769b302
restart: unless-stopped
volumes:
- pg_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${SERVICE_PASSWORD_POSTGRES}
POSTGRES_DB: roomote
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"']
interval: 5s
timeout: 30s
retries: 5
start_period: 30s
redis:
image: redis:7-alpine@sha256:6ab0b6e7381779332f97b8ca76193e45b0756f38d4c0dcda72dbb3c32061ab99
restart: unless-stopped
volumes:
- redis_data:/data
command: redis-server --appendonly yes
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
timeout: 3s
retries: 12
minio:
image: minio/minio:RELEASE.2025-09-07T16-13-09Z@sha256:14cea493d9a34af32f524e538b8346cf79f3321eff8e708c1e2960462bd8936e
restart: unless-stopped
command: server /data --console-address ':9001'
volumes:
- minio_data:/data
environment:
# Declares the public domain for presigned artifact URLs; Coolify
# routes it to the S3 API on port 9000 (the console on 9001 stays
# private).
SERVICE_FQDN_MINIO_9000: ''
MINIO_ROOT_USER: roomote
MINIO_ROOT_PASSWORD: ${SERVICE_PASSWORD_MINIO}
healthcheck:
# The minio/minio image ships no curl; `mc ready local` is MinIO's
# documented container healthcheck.
test: ['CMD', 'mc', 'ready', 'local']
interval: 5s
timeout: 5s
retries: 12
start_period: 20s
docker-proxy:
image: ghcr.io/tecnativa/docker-socket-proxy:v0.4.2@sha256:1f3a6f303320723d199d2316a3e82b2e2685d86c275d5e3deeaf182573b47476
restart: unless-stopped
read_only: true
tmpfs:
- /tmp:rw,noexec,nosuid,nodev,size=16m,mode=1777
- /run:rw,noexec,nosuid,nodev,size=4m,mode=755
cap_drop: [ALL]
security_opt: ['no-new-privileges:true']
environment:
CONTAINERS: '1'
ALLOW_START: '1'
EXEC: '1'
IMAGES: '1'
NETWORKS: '1'
POST: '1'
EVENTS: '0'
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks: [docker-api]
# One-shot Drizzle migration run before the app services start.
# `exclude_from_hc` is a Coolify-specific field that keeps this exited
# one-shot container from marking the whole resource unhealthy.
db-migrate:
image: *roomote-app-image
restart: 'no'
exclude_from_hc: true
command: db-migrate
depends_on:
postgres:
condition: service_healthy
environment:
<<: *roomote-shared-env
api:
image: *roomote-app-image
restart: unless-stopped
command: api
depends_on:
redis:
condition: service_started
db-migrate:
condition: service_completed_successfully
environment:
# Task workers and GitHub webhooks call this origin directly, so the
# api domain must be publicly reachable over HTTPS.
SERVICE_FQDN_API_3001: ''
<<: *roomote-shared-env
PORT: 3001
healthcheck:
test:
[
'CMD-SHELL',
'curl -fsS --max-time 2 http://127.0.0.1:3001/health/liveness >/dev/null',
]
interval: 5s
timeout: 3s
retries: 12
start_period: 20s
web:
image: *roomote-app-image
restart: unless-stopped
command: web
depends_on:
api:
condition: service_started
environment:
# This is the app origin users open in the browser.
SERVICE_FQDN_WEB_3000: ''
<<: *roomote-shared-env
PORT: 3000
healthcheck:
test:
[
'CMD-SHELL',
'curl -fsS --max-time 2 http://127.0.0.1:3000/health >/dev/null',
]
interval: 5s
timeout: 3s
retries: 12
start_period: 20s
controller:
image: *roomote-app-image
restart: unless-stopped
command: controller
# The controller may be inside a worker spawn when Compose replaces the
# container; the long grace period lets it finish or fail the spawn.
stop_grace_period: 7m
depends_on:
redis:
condition: service_started
db-migrate:
condition: service_completed_successfully
api:
condition: service_started
docker-proxy:
condition: service_started
networks: [default, docker-api]
environment:
<<: *roomote-shared-env
DOCKER_HOST: tcp://docker-proxy:2375
# The worker release archive is baked into the app image; the
# controller reads the release version from the VERSION file inside
# the archive. Do not unset: the fallback is GitHub worker releases,
# which do not exist for develop builds.
DOCKER_WORKER_RELEASE_PATH: /roomote/releases/worker-current.tar.gz
# Must match the name of this stack's Docker network (declared at the
# bottom of this file) so spawned worker containers can reach the
# stack. Verify with `docker network ls` on the Coolify server.
#
# The controller uses this network only to discover the labeled API and
# optional preview-proxy services. Spawned workers receive per-task
# networks, so they do not join roomote_default or gain access to its
# datastores.
DOCKER_WORKER_NETWORK: roomote_default
# Keep false unless the host enforces an equivalent storage quota.
DOCKER_WORKER_ALLOW_UNBOUNDED_DISK: ${DOCKER_WORKER_ALLOW_UNBOUNDED_DISK:-false}
healthcheck:
test:
[
'CMD-SHELL',
'curl -fsS --max-time 5 http://api:3001/health/controller >/dev/null',
]
interval: 5s
timeout: 6s
retries: 12
start_period: 20s
bullmq:
image: *roomote-app-image
restart: unless-stopped
command: bullmq
depends_on:
redis:
condition: service_started
db-migrate:
condition: service_completed_successfully
environment:
<<: *roomote-shared-env
PORT: 3002
healthcheck:
test:
[
'CMD-SHELL',
'curl -fsS --max-time 5 http://127.0.0.1:3002/admin/health >/dev/null',
]
interval: 5s
timeout: 6s
retries: 12
start_period: 20s
# Optional. Uncomment only when enabling live previews with a wildcard
# domain routed to this service; everything else works without it. See
# "Live previews" in README.md.
# preview-proxy:
# image: *roomote-app-image
# restart: unless-stopped
# command: preview-proxy
# depends_on:
# db-migrate:
# condition: service_completed_successfully
# environment:
# SERVICE_FQDN_PREVIEWPROXY_8081: ''
# <<: *roomote-shared-env
# PORT: 8081
# PREVIEW_PROXY_BASE_URL: https://previews.<your-domain>
# NEXT_PUBLIC_PREVIEW_PROXY_BASE_URL: https://previews.<your-domain>
# PREVIEW_DOMAINS: previews.<your-domain>
# healthcheck:
# test:
# [
# 'CMD-SHELL',
# 'curl -fsS --max-time 2 http://127.0.0.1:8081/health >/dev/null',
# ]
# interval: 5s
# timeout: 3s
# retries: 12
# start_period: 20s
volumes:
pg_data:
redis_data:
minio_data:
networks:
# Named explicitly so the controller's DOCKER_WORKER_NETWORK value is
# stable across redeploys. Coolify may attach additional networks of its
# own; that is fine as long as this one exists.
default:
name: roomote_default
driver: bridge
docker-api:
name: roomote_docker_api
driver: bridge
internal: true