Skip to content

Commit e4ff1cd

Browse files
fix railway build (#2325)
1 parent b8f95f8 commit e4ff1cd

3 files changed

Lines changed: 54 additions & 44 deletions

File tree

apps/workflows/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ COPY \
106106
--link \
107107
"packages/status-fetcher/package.json" "/app/packages/status-fetcher/package.json"
108108
RUN \
109-
--mount=type=cache,target=/root/.local/share/pnpm/store,sharing=locked \
109+
--mount=type=cache,target=/root/.local/share/pnpm/store,id=s/3a5c916e-f3f2-4f35-ba0e-3c8511b6f9a3-/root/.local/share/pnpm/store,sharing=locked \
110110
<<EOF
111111
corepack enable pnpm
112112
pnpm install --prod --frozen-lockfile --filter=@openstatus/workflows... --verbose

apps/workflows/dofigen.lock

Lines changed: 48 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -12,48 +12,14 @@ effective: |
1212
- /packages/error
1313
- /packages/tracker
1414
builders:
15-
build:
16-
fromImage:
17-
path: denoland/deno
18-
digest: sha256:8d24854de78a79c56e74b49aa4c5996c60e1fe3730efba8fbdd2692c582e6e29
19-
label:
20-
org.opencontainers.image.stage: build
21-
org.opencontainers.image.base.name: docker.io/denoland/deno:2.9.0
22-
org.opencontainers.image.base.digest: sha256:8d24854de78a79c56e74b49aa4c5996c60e1fe3730efba8fbdd2692c582e6e29
23-
workdir: /app/apps/workflows
24-
env:
25-
NODE_ENV: production
26-
copy:
27-
- paths:
28-
- .
29-
target: /app/
30-
- fromBuilder: install
31-
paths:
32-
- /app/node_modules
33-
target: /app/node_modules
34-
- fromBuilder: install
35-
paths:
36-
- /app/apps/workflows/node_modules
37-
target: /app/apps/workflows/node_modules
38-
- fromBuilder: install
39-
paths:
40-
- /app/packages
41-
target: /app/packages
42-
run:
43-
- mkdir -p /tmp/sc
44-
- deno eval 'const p="/app/node_modules/.pnpm";const v=(x)=>{for(const e of Deno.readDirSync(p))if(e.name.startsWith(x+"@"))return e.name.slice(x.length+1).split("_")[0]};Deno.writeTextFileSync("/tmp/sc/package.json",JSON.stringify({dependencies:{"@libsql/client":v("@libsql+client"),libsql:v("libsql"),"@google-cloud/tasks":v("@google-cloud+tasks")}}))'
45-
- cd /tmp/sc && deno install --node-modules-dir=auto --allow-scripts
46-
- cd /app/apps/workflows && deno bundle --platform=deno --minify --sloppy-imports --node-modules-dir=manual --external '@libsql/client' --external 'libsql' --external '@google-cloud/tasks' --output /tmp/sc/_serve.bundle.mjs src/serve.ts
47-
- cd /tmp/sc && deno compile --no-check -A --node-modules-dir=manual --output /app/apps/workflows/app /tmp/sc/_serve.bundle.mjs
48-
- mkdir -p /app/data
4915
install:
5016
fromImage:
5117
path: node
5218
digest: sha256:b31e7a42fdf8b8aa5f5ed477c72d694301273f1069c5a2f71d53c6482e99a2fc
5319
label:
20+
org.opencontainers.image.base.digest: sha256:b31e7a42fdf8b8aa5f5ed477c72d694301273f1069c5a2f71d53c6482e99a2fc
5421
org.opencontainers.image.stage: install
5522
org.opencontainers.image.base.name: docker.io/node:24-slim
56-
org.opencontainers.image.base.digest: sha256:b31e7a42fdf8b8aa5f5ed477c72d694301273f1069c5a2f71d53c6482e99a2fc
5723
workdir: /app/
5824
copy:
5925
- paths:
@@ -156,20 +122,56 @@ effective: |
156122
- corepack enable pnpm
157123
- pnpm install --prod --frozen-lockfile --filter=@openstatus/workflows... --verbose
158124
cache:
159-
- target: /root/.local/share/pnpm/store
125+
- id: s/3a5c916e-f3f2-4f35-ba0e-3c8511b6f9a3-/root/.local/share/pnpm/store
126+
target: /root/.local/share/pnpm/store
127+
sharing: locked
128+
build:
129+
fromImage:
130+
path: denoland/deno
131+
digest: sha256:8d24854de78a79c56e74b49aa4c5996c60e1fe3730efba8fbdd2692c582e6e29
132+
label:
133+
org.opencontainers.image.base.digest: sha256:8d24854de78a79c56e74b49aa4c5996c60e1fe3730efba8fbdd2692c582e6e29
134+
org.opencontainers.image.stage: build
135+
org.opencontainers.image.base.name: docker.io/denoland/deno:2.9.0
136+
workdir: /app/apps/workflows
137+
env:
138+
NODE_ENV: production
139+
copy:
140+
- paths:
141+
- .
142+
target: /app/
143+
- fromBuilder: install
144+
paths:
145+
- /app/node_modules
146+
target: /app/node_modules
147+
- fromBuilder: install
148+
paths:
149+
- /app/apps/workflows/node_modules
150+
target: /app/apps/workflows/node_modules
151+
- fromBuilder: install
152+
paths:
153+
- /app/packages
154+
target: /app/packages
155+
run:
156+
- mkdir -p /tmp/sc
157+
- deno eval 'const p="/app/node_modules/.pnpm";const v=(x)=>{for(const e of Deno.readDirSync(p))if(e.name.startsWith(x+"@"))return e.name.slice(x.length+1).split("_")[0]};Deno.writeTextFileSync("/tmp/sc/package.json",JSON.stringify({dependencies:{"@libsql/client":v("@libsql+client"),libsql:v("libsql"),"@google-cloud/tasks":v("@google-cloud+tasks")}}))'
158+
- cd /tmp/sc && deno install --node-modules-dir=auto --allow-scripts
159+
- cd /app/apps/workflows && deno bundle --platform=deno --minify --sloppy-imports --node-modules-dir=manual --external '@libsql/client' --external 'libsql' --external '@google-cloud/tasks' --output /tmp/sc/_serve.bundle.mjs src/serve.ts
160+
- cd /tmp/sc && deno compile --no-check -A --node-modules-dir=manual --output /app/apps/workflows/app /tmp/sc/_serve.bundle.mjs
161+
- mkdir -p /app/data
160162
fromImage:
161163
host: registry.access.redhat.com
162164
port: 443
163165
path: hi/curl
164166
digest: sha256:848b81ab5d5e55371d7193fd4f1ea7b605d14dbb039344ffad34a4c1f0d880f4
165167
label:
166-
org.opencontainers.image.description: Background job processing and probe scheduling for OpenStatus
167-
io.dofigen.version: 2.8.0
168-
org.opencontainers.image.authors: OpenStatus Team
169-
org.opencontainers.image.vendor: OpenStatus
170168
org.opencontainers.image.title: OpenStatus Workflows
169+
org.opencontainers.image.vendor: OpenStatus
170+
org.opencontainers.image.authors: OpenStatus Team
171171
org.opencontainers.image.source: https://github.com/openstatusHQ/openstatus
172172
org.opencontainers.image.base.digest: sha256:848b81ab5d5e55371d7193fd4f1ea7b605d14dbb039344ffad34a4c1f0d880f4
173+
org.opencontainers.image.description: Background job processing and probe scheduling for OpenStatus
174+
io.dofigen.version: 2.8.0
173175
user:
174176
user: '1000'
175177
group: '1000'
@@ -206,7 +208,7 @@ images:
206208
digest: sha256:b31e7a42fdf8b8aa5f5ed477c72d694301273f1069c5a2f71d53c6482e99a2fc
207209
resources:
208210
dofigen.yml:
209-
hash: 6e664d2b4d9649d3d56b5e2f244d826f1c4fc9f9633191d7ed38bae6ea4e12d2
211+
hash: 416be0bdb8fcc1bc717f637b38cfa3b095b5277c947ad7e55d51b98194fdd856
210212
content: |
211213
ignore:
212214
- node_modules
@@ -268,7 +270,11 @@ resources:
268270
- corepack enable pnpm
269271
- pnpm install --prod --frozen-lockfile --filter=@openstatus/workflows... --verbose
270272
cache:
271-
- /root/.local/share/pnpm/store
273+
# Railway scopes cache mounts per service: the id must be literally
274+
# s/<service-id>-<target> (env vars aren't allowed in the id).
275+
- id: s/3a5c916e-f3f2-4f35-ba0e-3c8511b6f9a3-/root/.local/share/pnpm/store
276+
target: /root/.local/share/pnpm/store
277+
sharing: locked
272278

273279
# Stage 4: Build application (compile to binary with Deno)
274280
build:

apps/workflows/dofigen.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ builders:
5858
- corepack enable pnpm
5959
- pnpm install --prod --frozen-lockfile --filter=@openstatus/workflows... --verbose
6060
cache:
61-
- /root/.local/share/pnpm/store
61+
# Railway scopes cache mounts per service: the id must be literally
62+
# s/<service-id>-<target> (env vars aren't allowed in the id).
63+
- id: s/3a5c916e-f3f2-4f35-ba0e-3c8511b6f9a3-/root/.local/share/pnpm/store
64+
target: /root/.local/share/pnpm/store
65+
sharing: locked
6266

6367
# Stage 4: Build application (compile to binary with Deno)
6468
build:

0 commit comments

Comments
 (0)