update
This commit is contained in:
32
src/Managing.WebApp/Dockerfile-web-ui-dev
Normal file
32
src/Managing.WebApp/Dockerfile-web-ui-dev
Normal file
@@ -0,0 +1,32 @@
|
||||
# Stage 1: Build the Vite application
|
||||
FROM node:20 AS builder
|
||||
|
||||
# Set the working directory in the container
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the package.json and package-lock.json first to leverage Docker's cache
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm ci --only=production
|
||||
|
||||
# Copy the application code
|
||||
COPY . .
|
||||
|
||||
# Build the Vite application
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: Create the runtime image
|
||||
FROM nginx:alpine
|
||||
|
||||
# Copy the built Vite application from the builder stage
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
|
||||
# Copy a custom Nginx configuration file (if you need one)
|
||||
# COPY nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
# Expose port 80
|
||||
EXPOSE 80
|
||||
|
||||
# Start the Nginx server
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user