From b639e92eecca1bb8d82830ca7f80226a54b13ae0 Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 25 Sep 2026 08:31:29 +0000 Subject: [PATCH 1/2] Restore the from-source Dockerfile so Railway can build any branch --- Dockerfile | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..db235b832f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,39 @@ +# syntax=docker/dockerfile:1 +FROM node:24.18.1-bookworm-slim AS node + +FROM rust:1.97.1-bookworm AS sdk +COPY --from=node /usr/local/bin/node /usr/local/bin/node +WORKDIR /app +# Dashboard edits must not invalidate this layer. +COPY core/ core/ +# Railway requires its literal service ID; BuildKit on Ployz accepts the same cache IDs. +RUN --mount=type=cache,id=s/8089d161-49d3-4c77-b683-2bede5a784f5-/usr/local/cargo/registry,target=/usr/local/cargo/registry \ + --mount=type=cache,id=s/8089d161-49d3-4c77-b683-2bede5a784f5-/usr/local/cargo/git,target=/usr/local/cargo/git \ + --mount=type=cache,id=s/8089d161-49d3-4c77-b683-2bede5a784f5-/app/core/target,target=/app/core/target \ + bash core/scripts/build-cloud-sdk.sh + +FROM node AS dashboard +RUN npm install --global pnpm@11.7.0 +WORKDIR /app/dashboard +COPY dashboard/package.json dashboard/pnpm-lock.yaml dashboard/pnpm-workspace.yaml ./ +COPY dashboard/patches/ patches/ +COPY --from=sdk /app/core/crates/ployz-sdk /app/core/crates/ployz-sdk +RUN --mount=type=cache,id=s/8089d161-49d3-4c77-b683-2bede5a784f5-/root/.local/share/pnpm/store,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile +COPY dashboard/ ./ +# The SDK was built above; do not run package.json's combined Rust + Vite build. +RUN pnpm build:app && pnpm prune --prod + +FROM node AS runtime +RUN apt-get update \ + && apt-get install -y --no-install-recommends ca-certificates git openssh-client \ + && rm -rf /var/lib/apt/lists/* +ENV NODE_ENV=production +WORKDIR /app +COPY --from=dashboard /app/dashboard/.output .output +COPY --from=dashboard /app/dashboard/node_modules node_modules +# The app's packaged SDK is the runtime copy; replace pnpm's source-tree link. +RUN ln -sfn /app/.output/server/node_modules/@ployz/sdk node_modules/@ployz/sdk +COPY dashboard/package.json dashboard/drizzle.config.ts ./ +COPY dashboard/drizzle/ drizzle/ +# Load the OpenTelemetry SDK before the app; it reads Railway's OTEL_* variables. +CMD ["node", "--experimental-loader=@opentelemetry/instrumentation/hook.mjs", "--import", "@opentelemetry/auto-instrumentations-node/register", ".output/server/index.mjs"] From c5aac72cdf75621298da41cae3f248db477c2b0f Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 25 Sep 2026 08:31:41 +0000 Subject: [PATCH 2/2] Document the from-source Dockerfile --- README.md | 1 + dashboard/README.md | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 67c0e858c3..a8aa57ca12 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ the same Cluster over SSH contexts. Neither is a control plane. ```text core/ Cargo workspace, installer, release scripts dashboard/ pnpm application; self-host/ holds the Compose deployment +Dockerfile Cloud image built from source; Railway builds branches with it Dockerfile.cloud Cloud runtime image, packaged by the Cloud CI job scripts/ CI check selection .github/ Workflows diff --git a/dashboard/README.md b/dashboard/README.md index 0dbac765a0..9311ae32c9 100644 --- a/dashboard/README.md +++ b/dashboard/README.md @@ -48,7 +48,9 @@ what is missing or invalid. ## Build and deploy `pnpm build` compiles the native SDK and config WASM, then builds the web and -Connect worker into `.output/`. `Dockerfile.cloud` packages both in one image: +Connect worker into `.output/`. `Dockerfile.cloud` packages both in one image; +the root `Dockerfile` builds the same image from source, so Railway can deploy +any branch without CI: | Process | Start command | Healthcheck | | --- | --- | --- |