-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Make Node version configurable + verify Node 25 compatibility (Docker + Swarm) #4254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: canary
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,11 @@ | ||
| # syntax=docker/dockerfile:1 | ||
| FROM node:24.4.0-slim AS base | ||
| ARG NODE_VERSION=24.4.0 | ||
| FROM node:${NODE_VERSION}-slim AS base | ||
| ENV PNPM_HOME="/pnpm" | ||
| ENV PATH="$PNPM_HOME:$PATH" | ||
| RUN corepack enable | ||
| RUN corepack prepare pnpm@10.22.0 --activate | ||
| RUN corepack enable || true && \ | ||
| corepack prepare pnpm@10.22.0 --activate || \ | ||
| npm install -g pnpm@10.22.0 | ||
|
|
||
| FROM base AS build | ||
| COPY . /usr/src/app | ||
|
|
@@ -40,7 +42,7 @@ COPY --from=build /prod/dokploy/next.config.mjs ./next.config.mjs | |
| COPY --from=build /prod/dokploy/public ./public | ||
| COPY --from=build /prod/dokploy/package.json ./package.json | ||
| COPY --from=build /prod/dokploy/drizzle ./drizzle | ||
| COPY .env.production ./.env | ||
| #COPY .env.production ./.env (# Env should be provided at runtime (not baked into image)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Commenting out this line silently removes a file that the app may rely on to start. Any existing deployment that depended on If the intent is to require runtime-supplied env vars going forward, this should be an explicit, documented migration step — not a silent comment-out. Consider keeping the |
||
| COPY --from=build /prod/dokploy/components.json ./components.json | ||
| COPY --from=build /prod/dokploy/node_modules ./node_modules | ||
|
|
||
|
|
@@ -69,4 +71,4 @@ EXPOSE 3000 | |
| HEALTHCHECK --interval=10s --timeout=3s --retries=10 \ | ||
| CMD curl -fs http://localhost:3000/api/trpc/settings.health || exit 1 | ||
|
|
||
| CMD ["sh", "-c", "pnpm run wait-for-postgres && exec pnpm start"] | ||
| CMD ["sh", "-c", "pnpm run wait-for-postgres && exec pnpm start"] | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
corepack enable || truealways exits 0, so any genuine failure ofcorepack enable(e.g. a permissions issue on a node image that does include corepack) is silently ignored. The layer then proceeds to runcorepack prepare, which will also fail and fall back to npm — leaving the image in a state where pnpm was installed via a different mechanism than expected, without any build-time warning.A safer pattern is to check whether
corepackis available first, rather than suppressing its errors unconditionally: