T01: update frontend Dockerfile
This commit is contained in:
+12
-9
@@ -1,20 +1,23 @@
|
|||||||
FROM node:22-alpine AS build
|
# Use Node.js 22 LTS as base image
|
||||||
|
FROM node:22-alpine
|
||||||
|
|
||||||
|
# Set working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy package files
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
RUN npm ci
|
RUN npm ci
|
||||||
|
|
||||||
|
# Copy source code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# Build the application
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
FROM nginx:alpine
|
# Expose port 8080
|
||||||
RUN apk add --no-cache curl
|
EXPOSE 8080
|
||||||
|
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
# Run the application
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
CMD ["npm", "run", "preview"]
|
||||||
|
|
||||||
EXPOSE 80
|
|
||||||
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
|
||||||
Reference in New Issue
Block a user