-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9819365
commit 9608557
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM node:20-alpine AS base | ||
|
||
FROM base AS builder | ||
|
||
RUN apk add --no-cache libc6-compat | ||
WORKDIR /app | ||
|
||
COPY package*json tsconfig.json src ./ | ||
|
||
RUN npm ci && \ | ||
npm run build && \ | ||
npm prune --production | ||
|
||
FROM base AS runner | ||
WORKDIR /app | ||
|
||
RUN addgroup --system --gid 1001 nodejs | ||
RUN adduser --system --uid 1001 hono | ||
|
||
COPY --from=builder --chown=hono:nodejs /app/node_modules /app/node_modules | ||
COPY --from=builder --chown=hono:nodejs /app/dist /app/dist | ||
|
||
USER hono | ||
EXPOSE 3000 | ||
|
||
CMD ["node", "server.js"] |