first commit
This commit is contained in:
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@@ -0,0 +1,14 @@
|
||||
# Stage 1: install production dependencies
|
||||
FROM node:20-alpine AS deps
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm install --omit=dev
|
||||
|
||||
# Stage 2: final image — no dev tools, no npm cache
|
||||
FROM node:20-alpine
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY src/ ./src/
|
||||
EXPOSE 3000
|
||||
USER node
|
||||
CMD ["node", "src/index.js"]
|
||||
Reference in New Issue
Block a user