feat: update backend Dockerfile for Node.js app
This commit is contained in:
+2
-12
@@ -1,23 +1,13 @@
|
|||||||
# Use Node.js 22 LTS as base image
|
|
||||||
FROM node:22-alpine
|
FROM node:22-alpine
|
||||||
|
|
||||||
# Set working directory
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy package files
|
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
RUN npm ci --only=production
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
RUN npm ci
|
|
||||||
|
|
||||||
# Copy source code
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build the application
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Expose port 3001
|
|
||||||
EXPOSE 3001
|
EXPOSE 3001
|
||||||
|
|
||||||
# Run the application
|
CMD ["node", "dist/index.js"]
|
||||||
CMD ["npm", "start"]
|
|
||||||
Reference in New Issue
Block a user