From 6b2f93b962424dd96d8128c7a2c0cc85c567b715 Mon Sep 17 00:00:00 2001 From: eee4 <41441600+eee4@users.noreply.github.com> Date: Tue, 2 Dec 2025 22:59:21 +0100 Subject: [PATCH] feat: add a Dockerfile for image building --- Dockerfile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7bcd961 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +# Credit: https://www.digitalocean.com/community/tutorials/how-to-build-a-node-js-application-with-docker + +FROM node:22-alpine AS builder + +WORKDIR /app +COPY package*.json ./ +RUN npm ci --only=production && npm cache clean --force +COPY . . + +FROM node:22-alpine AS production + +WORKDIR /app +RUN addgroup -g 1001 -S nodejs && \ + adduser -S js -u 1001 +COPY --from=builder --chown=js:nodejs /app /app +USER js +EXPOSE 6567 + +CMD ["npm", "run", "server"] \ No newline at end of file