Skip to content

Commit b5dfd5b

Browse files
committed
feat: update Dockerfile to use node:22-alpine and adjust user/group ownership
1 parent ffc71ce commit b5dfd5b

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

apps/server/Dockerfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,41 @@
1-
FROM oven/bun:alpine AS base
1+
FROM node:22-alpine AS base
22

33

44
FROM base AS builder
55

66
WORKDIR /app
77
COPY . .
8-
RUN bunx turbo prune @kbnet/server --docker
8+
RUN npx turbo prune @kbnet/server --docker
99

1010

1111
# Add lockfile and package.json's of isolated subworkspace
1212
FROM base AS installer
1313
WORKDIR /app
1414
# First install the dependencies (as they change less often)
15+
RUN npm install -g bun@latest
1516
COPY --from=builder /app/out/json/ .
1617
RUN bun install
1718

1819

1920
# Build the project
21+
RUN npm install -g bun@latest
2022
COPY --from=builder /app/out/full/ .
2123
RUN bunx turbo run build
2224

2325

2426
FROM base AS runner
2527
WORKDIR /app
2628

27-
RUN addgroup --system --gid 1001 node
29+
RUN addgroup --system --gid 1001 kbnet
2830
RUN adduser --system --uid 1001 bunuser
2931
USER bunuser
3032

31-
COPY --from=installer --chown=bunuser:node /app/apps/server/dist ./
32-
COPY --from=installer --chown=bunuser:node /app/packages/database/generated /app/generated
33-
COPY --from=installer --chown=bunuser:node /app/node_modules ./node_modules
34-
COPY --from=installer --chown=bunuser:node /app/package.json ./package.json
35-
COPY --from=installer --chown=bunuser:node /app/turbo.json ./turbo.json
36-
COPY --from=installer --chown=bunuser:node /app/package.json ./package.json
33+
COPY --from=installer --chown=bunuser:kbnet /app/apps/server/dist ./
34+
COPY --from=installer --chown=bunuser:kbnet /app/packages/database/generated /app/generated
35+
COPY --from=installer --chown=bunuser:kbnet /app/node_modules ./node_modules
36+
COPY --from=installer --chown=bunuser:kbnet /app/package.json ./package.json
37+
COPY --from=installer --chown=bunuser:kbnet /app/turbo.json ./turbo.json
38+
COPY --from=installer --chown=bunuser:kbnet /app/package.json ./package.json
3739

3840

3941
EXPOSE 8000

0 commit comments

Comments
 (0)