Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion dashboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
| --- | --- | --- |
Expand Down
Loading