feat: add a Dockerfile for image building

This commit is contained in:
2025-12-02 22:59:21 +01:00
parent 1b8c9ccaeb
commit 6b2f93b962

19
Dockerfile Normal file
View File

@@ -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"]