feat: Dockerfile
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
node_modules/
|
||||
dist/
|
||||
data/
|
||||
.env
|
||||
*.md
|
||||
.git/
|
||||
+20
@@ -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"]
|
||||
Reference in New Issue
Block a user