Added dockerization

This commit is contained in:
Trushy committed 2025-09-29 15:45:59 +02:00
1 parent a949b44233
commit 13383ef596
3 files changed
+39 -1

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
ARG NODE_VERSION=24.6.0
FROM node:${NODE_VERSION}-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN --mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=package-lock.json,target=package-lock.json \
--mount=type=cache,target=/root/.npm \
npm ci
COPY . .
RUN npm prune --production
FROM node:${NODE_VERSION}-alpine
WORKDIR /app
COPY --from=builder /app/node_modules node_modules/
COPY --from=builder /app/index.js .
USER node
EXPOSE 12345
ENV NODE_ENV=production
CMD [ "node", "."]