diff --git a/apps/workflows/Dockerfile b/apps/workflows/Dockerfile index c17729fc..1b403140 100644 --- a/apps/workflows/Dockerfile +++ b/apps/workflows/Dockerfile @@ -106,7 +106,7 @@ COPY \ --link \ "packages/status-fetcher/package.json" "/app/packages/status-fetcher/package.json" RUN \ - --mount=type=cache,target=/root/.local/share/pnpm/store,sharing=locked \ + --mount=type=cache,target=/root/.local/share/pnpm/store,id=s/3a5c916e-f3f2-4f35-ba0e-3c8511b6f9a3-/root/.local/share/pnpm/store,sharing=locked \ <{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")}}))' - - cd /tmp/sc && deno install --node-modules-dir=auto --allow-scripts - - 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 - - cd /tmp/sc && deno compile --no-check -A --node-modules-dir=manual --output /app/apps/workflows/app /tmp/sc/_serve.bundle.mjs - - mkdir -p /app/data install: fromImage: path: node digest: sha256:b31e7a42fdf8b8aa5f5ed477c72d694301273f1069c5a2f71d53c6482e99a2fc label: + org.opencontainers.image.base.digest: sha256:b31e7a42fdf8b8aa5f5ed477c72d694301273f1069c5a2f71d53c6482e99a2fc org.opencontainers.image.stage: install org.opencontainers.image.base.name: docker.io/node:24-slim - org.opencontainers.image.base.digest: sha256:b31e7a42fdf8b8aa5f5ed477c72d694301273f1069c5a2f71d53c6482e99a2fc workdir: /app/ copy: - paths: @@ -156,20 +122,56 @@ effective: | - corepack enable pnpm - pnpm install --prod --frozen-lockfile --filter=@openstatus/workflows... --verbose cache: - - target: /root/.local/share/pnpm/store + - id: s/3a5c916e-f3f2-4f35-ba0e-3c8511b6f9a3-/root/.local/share/pnpm/store + target: /root/.local/share/pnpm/store + sharing: locked + build: + fromImage: + path: denoland/deno + digest: sha256:8d24854de78a79c56e74b49aa4c5996c60e1fe3730efba8fbdd2692c582e6e29 + label: + org.opencontainers.image.base.digest: sha256:8d24854de78a79c56e74b49aa4c5996c60e1fe3730efba8fbdd2692c582e6e29 + org.opencontainers.image.stage: build + org.opencontainers.image.base.name: docker.io/denoland/deno:2.9.0 + workdir: /app/apps/workflows + env: + NODE_ENV: production + copy: + - paths: + - . + target: /app/ + - fromBuilder: install + paths: + - /app/node_modules + target: /app/node_modules + - fromBuilder: install + paths: + - /app/apps/workflows/node_modules + target: /app/apps/workflows/node_modules + - fromBuilder: install + paths: + - /app/packages + target: /app/packages + run: + - mkdir -p /tmp/sc + - 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")}}))' + - cd /tmp/sc && deno install --node-modules-dir=auto --allow-scripts + - 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 + - cd /tmp/sc && deno compile --no-check -A --node-modules-dir=manual --output /app/apps/workflows/app /tmp/sc/_serve.bundle.mjs + - mkdir -p /app/data fromImage: host: registry.access.redhat.com port: 443 path: hi/curl digest: sha256:848b81ab5d5e55371d7193fd4f1ea7b605d14dbb039344ffad34a4c1f0d880f4 label: - org.opencontainers.image.description: Background job processing and probe scheduling for OpenStatus - io.dofigen.version: 2.8.0 - org.opencontainers.image.authors: OpenStatus Team - org.opencontainers.image.vendor: OpenStatus org.opencontainers.image.title: OpenStatus Workflows + org.opencontainers.image.vendor: OpenStatus + org.opencontainers.image.authors: OpenStatus Team org.opencontainers.image.source: https://github.com/openstatusHQ/openstatus org.opencontainers.image.base.digest: sha256:848b81ab5d5e55371d7193fd4f1ea7b605d14dbb039344ffad34a4c1f0d880f4 + org.opencontainers.image.description: Background job processing and probe scheduling for OpenStatus + io.dofigen.version: 2.8.0 user: user: '1000' group: '1000' @@ -206,7 +208,7 @@ images: digest: sha256:b31e7a42fdf8b8aa5f5ed477c72d694301273f1069c5a2f71d53c6482e99a2fc resources: dofigen.yml: - hash: 6e664d2b4d9649d3d56b5e2f244d826f1c4fc9f9633191d7ed38bae6ea4e12d2 + hash: 416be0bdb8fcc1bc717f637b38cfa3b095b5277c947ad7e55d51b98194fdd856 content: | ignore: - node_modules @@ -268,7 +270,11 @@ resources: - corepack enable pnpm - pnpm install --prod --frozen-lockfile --filter=@openstatus/workflows... --verbose cache: - - /root/.local/share/pnpm/store + # Railway scopes cache mounts per service: the id must be literally + # s/- (env vars aren't allowed in the id). + - id: s/3a5c916e-f3f2-4f35-ba0e-3c8511b6f9a3-/root/.local/share/pnpm/store + target: /root/.local/share/pnpm/store + sharing: locked # Stage 4: Build application (compile to binary with Deno) build: diff --git a/apps/workflows/dofigen.yml b/apps/workflows/dofigen.yml index 37f21bee..a49cf4a8 100644 --- a/apps/workflows/dofigen.yml +++ b/apps/workflows/dofigen.yml @@ -58,7 +58,11 @@ builders: - corepack enable pnpm - pnpm install --prod --frozen-lockfile --filter=@openstatus/workflows... --verbose cache: - - /root/.local/share/pnpm/store + # Railway scopes cache mounts per service: the id must be literally + # s/- (env vars aren't allowed in the id). + - id: s/3a5c916e-f3f2-4f35-ba0e-3c8511b6f9a3-/root/.local/share/pnpm/store + target: /root/.local/share/pnpm/store + sharing: locked # Stage 4: Build application (compile to binary with Deno) build: