T01: update backend Dockerfile
This commit is contained in:
+14
-4
@@ -1,13 +1,23 @@
|
|||||||
|
# Use Node.js 22 LTS as base image
|
||||||
FROM node:22-alpine
|
FROM node:22-alpine
|
||||||
RUN apk add --no-cache curl
|
|
||||||
|
|
||||||
|
# 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 . .
|
||||||
|
|
||||||
EXPOSE 5000
|
# Build the application
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
CMD ["node", "server.js"]
|
# Expose port 3001
|
||||||
|
EXPOSE 3001
|
||||||
|
|
||||||
|
# Run the application
|
||||||
|
CMD ["npm", "start"]
|
||||||
Reference in New Issue
Block a user