Update Dockerfile
Browse files121234566789910101112131415151617181920212223242526272829303132333435161718193820# Build stageFROM node:20-alpine AS build# Use Node.js 20 as the base imageFROM node:20-alpine
# Set the working directory in the containerWORKDIR /app
# Copy package.json and package-lock.json (if exists)# Copy package.json and package-lock.json (if available)COPY package*.json ./
# Install all dependencies, including devDependenciesRUN npm ci# Install dependenciesRUN npm install
# Copy the rest of your application codeCOPY . .
# Build the applicationRUN npm run build
# Production stageFROM node:20-alpine AS production
WORKDIR /app
# Copy package.json and package-lock.json (if exists)COPY package*.json ./
# Install only production dependencies# Since there are no production dependencies, this step will be quickRUN npm ci --only=production
# Copy built assets from the build stageCOPY --from=build /app/dist ./dist
ENV NODE_ENV productionENV PORT 7860
# Expose the port your app runs onEXPOSE 7860
# Command to run your app in development modeCMD ["npm", "run", "start:prod"]CMD ["npm", "run", "start:dev"]Dockerfile+9-27