feat: Dockerfile

This commit is contained in:
2026-05-20 18:25:40 +02:00
parent 0efe63792e
commit c5079c12dc
2 changed files with 26 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
FROM node:20-alpine AS builder
WORKDIR /app
RUN apk add --no-cache python3 make g++
COPY package*.json ./
RUN npm ci
COPY tsconfig.json ./
COPY src ./src
RUN npm run build
FROM node:20-alpine AS runner
WORKDIR /app
RUN apk add --no-cache python3 make g++
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
COPY package*.json ./
RUN npm ci --omit=dev && npm cache clean --force
RUN apk del python3 make g++
COPY --from=builder /app/dist ./dist
RUN mkdir -p /app/data && chown appuser:appgroup /app/data
USER appuser
CMD ["node", "dist/index.js"]