Repository navigation
Expand file tree
/
Copy pathzerops.yml
More file actions
215 lines (210 loc) · 6.68 KB
/
Copy pathzerops.yml
File metadata and controls
215 lines (210 loc) · 6.68 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
# see https://docs.zerops.io/zerops-yml/specification for full reference
zerops:
# ===============================
# MARKETING (landing, TanStack Start / Node SSR)
# ===============================
- setup: marketing
build:
base: nodejs@22
prepareCommands:
# corepack ships with Node.js 22 — use it instead of npm install -g pnpm
- corepack enable && corepack prepare pnpm@latest --activate
buildCommands:
- pnpm i
- pnpm -F landing zerops:build
deployFiles:
# Strip apps/landing/ prefix so .output/ lands at container root
- apps/landing/~.output
- apps/landing/~package.json
- node_modules
deploy:
readinessCheck:
httpGet:
port: 3000
path: /
run:
base: nodejs@22
ports:
- port: 3000
httpSupport: true
envVariables:
PORT: 3000
HOST: 0.0.0.0
start: node .output/server/index.mjs
# ===============================
# BACKEND (Hono on Bun)
# ===============================
- setup: backend
build:
base: bun@latest
os: ubuntu
prepareCommands:
# Use corepack for pnpm
- corepack enable && corepack prepare pnpm@latest --activate
buildCommands:
# Prune the workspace down to backend + its dependency graph only
# (same tool the CE Dockerfiles use for the ghcr.io images) so we
# install/deploy just what this service needs instead of shipping
# the whole monorepo's node_modules to every service.
- bunx turbo prune backend
- cd out && pnpm install
- cd out && pnpm -F backend zerops:build
deployFiles:
# compiled backend bundle -> dist/
- out/apps/backend/~dist
# migration runner (compiled standalone JS) -> migrate.js
- out/packages/database/~migrate.js
# SQL migration files -> drizzle/
- out/packages/database/~drizzle
# startup script -> start.sh
- out/apps/backend/~start.sh
# package.json -> package.json
- out/apps/backend/~package.json
# pruned node_modules (backend's dependency subset only)
- out/~node_modules
deploy:
readinessCheck:
httpGet:
port: 5468
path: /api/health
run:
base: bun@latest
os: ubuntu
ports:
- port: 5468
httpSupport: true
initCommands:
# jsdom's bundled code resolves __dirname to the build-time path for
# its CSS assets. The build now runs from /build/source/out (pruned
# workspace), not /build/source directly, so the baked-in path is
# /build/source/out/node_modules/... — symlink that exact path to
# where node_modules actually lives at runtime.
- sudo mkdir -p /build/source/out && sudo ln -sf /var/www/node_modules /build/source/out/node_modules
start: chmod +x start.sh && sh start.sh
healthCheck:
httpGet:
port: 5468
path: /api/health
# ===============================
# START (TanStack Start / Node SSR)
# ===============================
- setup: start
build:
base: nodejs@22
envVariables:
NODE_OPTIONS: --max-old-space-size=8192
# These VITE_* / define vars are baked into the bundle at build time (see vite.config.ts)
APP_ENV: production
SAYR_EDITION: cloud
# PostHog: VITE_PUBLIC_POSTHOG_KEY, VITE_PUBLIC_POSTHOG_HOST, POSTHOG_CLI_TOKEN, and
# POSTHOG_CLI_ENV_ID are defined as project-level custom environment variables in Zerops
# and are injected automatically — do NOT redeclare them here or Zerops will create a
# recursive self-reference loop.
prepareCommands:
# corepack ships with Node.js 22 — use it instead of npm install -g pnpm
- corepack enable && corepack prepare pnpm@latest --activate
buildCommands:
- pnpm i
- pnpm -F start zerops:build
deployFiles:
# Strip apps/start/ prefix so .output/ lands at container root
- apps/start/~.output
- apps/start/~package.json
# Startup script: placeholder replacement + Nitro manifest size patching
- apps/start/~zerops-start.sh
- node_modules
deploy:
readinessCheck:
httpGet:
port: 3000
path: /health
run:
base: nodejs@22
ports:
- port: 3000
httpSupport: true
initCommands:
# Run placeholder replacement + Nitro asset manifest size patching
- chmod +x zerops-start.sh && sh zerops-start.sh
start: node .output/server/index.mjs
# ===============================
# WORKER (Bun background job processor)
# ===============================
- setup: workermain
build:
base: bun@latest
os: ubuntu
prepareCommands:
# Use corepack for pnpm
- corepack enable && corepack prepare pnpm@latest --activate
buildCommands:
- pnpm i
- pnpm -F worker zerops:build
deployFiles:
# Strip apps/worker/ prefix so dist/ lands at container root
- apps/worker/~dist
- apps/worker/~package.json
- node_modules
run:
base: bun@latest
os: ubuntu
ports:
- port: 8080
httpSupport: true
healthCheck:
httpGet:
port: 8080
path: /
start: bun run dist/index.js main
- setup: workergithub
build:
base: bun@latest
os: ubuntu
prepareCommands:
# Use corepack for pnpm
- corepack enable && corepack prepare pnpm@latest --activate
buildCommands:
- pnpm i
- pnpm -F worker zerops:build
deployFiles:
# Strip apps/worker/ prefix so dist/ lands at container root
- apps/worker/~dist
- apps/worker/~package.json
- node_modules
run:
base: bun@latest
os: ubuntu
ports:
- port: 8080
httpSupport: true
healthCheck:
httpGet:
port: 8080
path: /
start: bun run dist/index.js github
- setup: integrations
build:
base: bun@latest
os: ubuntu
prepareCommands:
# Use corepack for pnpm
- corepack enable && corepack prepare pnpm@latest --activate
buildCommands:
- pnpm i
- pnpm -F integrations build:all
deployFiles:
# Strip integrations/ prefix so dist/ lands at container root
- integrations/~dist
- integrations/~services
- node_modules
run:
base: bun@latest
os: ubuntu
ports:
- port: 8080
httpSupport: true
healthCheck:
httpGet:
port: 8080
path: /
start: bun run dist/index.js