Skip to content

Commit

Permalink
chore: add template docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaAmaju committed Mar 24, 2024
1 parent 9819365 commit 9608557
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions templates/basic/Dockerfile
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"]

0 comments on commit 9608557

Please sign in to comment.