feat: add a Dockerfile for image building
This commit is contained in:
19
Dockerfile
Normal file
19
Dockerfile
Normal 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"]
|
||||||
Reference in New Issue
Block a user