-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcompose.yml
More file actions
147 lines (138 loc) · 3.41 KB
/
compose.yml
File metadata and controls
147 lines (138 loc) · 3.41 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
volumes:
postgres_data:
services:
# Postgres
postgres:
image: postgres:15.1-alpine3.17
volumes:
- postgres_data:/var/lib/postgresql/data:rw
env_file:
- .env
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready --quiet --username=$POSTGRES_USER --dbname=$POSTGRES_DB",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
# NATS
nats:
image: nats:2.12.2-alpine3.22
healthcheck:
test: ["CMD-SHELL", "wget http://localhost:8222/healthz -q -S -O -"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
# OpenWorkers API
openworkers-api:
image: ghcr.io/openworkers/openworkers-api:v1.8.1
depends_on:
- postgate
env_file:
- .env
environment:
- NODE_ENV=production
healthcheck:
test:
[
"CMD-SHELL",
"wget --no-verbose --tries=1 --spider http://localhost:7000/api/health || exit 1",
]
interval: 60s
timeout: 5s
retries: 5
start_period: 10s
# OpenWorkers Dashboard
openworkers-dash:
image: ghcr.io/openworkers/openworkers-dash:v1.5.0
healthcheck:
test:
[
"CMD-SHELL",
"wget --no-verbose --tries=1 --spider http://127.0.0.1:80/ || exit 1",
]
interval: 30s
timeout: 5s
retries: 3
start_period: 5s
# Postgate (HTTP proxy for Postgres)
# Uses OpenWorkers database via views (postgate_databases, postgate_tokens)
postgate:
image: ghcr.io/openworkers/postgate:v0.1.6
environment:
- DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres/${POSTGRES_DB}
- RUST_LOG=postgate=info
- POSTGATE_HOST=0.0.0.0
- POSTGATE_PORT=6080
- POSTGATE_SKIP_MIGRATIONS=true
depends_on:
- postgres
# OpenWorkers Proxy
openworkers-proxy:
image: nginx:1.25.1-alpine-slim
depends_on:
- openworkers-runner
- openworkers-dash
- openworkers-api
- postgate
volumes:
- ${HTTP_TLS_CERTIFICATE}:/certs/ssl.crt:ro
- ${HTTP_TLS_KEY}:/certs/ssl.key:ro
- ./nginx:/etc/nginx:ro
healthcheck:
test:
[
"CMD-SHELL",
"wget --no-verbose --tries=1 --spider http://127.0.0.1/health || exit 1",
]
interval: 5s
timeout: 5s
retries: 5
start_period: 5s
# OpenWorkers Runner
openworkers-runner:
image: ghcr.io/openworkers/openworkers-runner:v0.14.4-v8-telemetry
env_file:
- .env
environment:
- RUST_LOG=info,openworkers_runner=debug,openworkers_runtime_v8=debug
- DB_TEST_BEFORE_ACQUIRE=false
depends_on:
- postgres
- nats
deploy:
replicas: 3
healthcheck:
test:
[
"CMD-SHELL",
"wget --no-verbose --tries=1 --spider http://127.0.0.1:8080/health || exit 1",
]
interval: 5s
timeout: 5s
retries: 5
start_period: 5s
# OpenWorkers Logs Service
openworkers-logs:
image: ghcr.io/openworkers/openworkers-logs:v0.1.5
env_file:
- .env
environment:
- RUST_LOG=openworkers_logs=info
depends_on:
- postgres
- nats
# OpenWorkers Scheduler Service
openworkers-scheduler:
image: ghcr.io/openworkers/openworkers-scheduler:v0.1.3
env_file:
- .env
environment:
- RUST_LOG=openworkers_scheduler=info
depends_on:
- postgres
- nats