fixed config bug
This commit is contained in:
+6
-15
@@ -1,29 +1,20 @@
|
|||||||
# Step 1: Build the app
|
# Step 1: Build
|
||||||
FROM node:20-alpine AS builder
|
FROM node:20-alpine AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
# Copy source code
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build the project
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
|
||||||
# Step 2: Run preview server
|
# Step 2: Serve static files
|
||||||
FROM node:20-alpine
|
FROM nginx:alpine
|
||||||
|
|
||||||
WORKDIR /app
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||||
|
|
||||||
# Copy built files and node_modules (for vite preview)
|
EXPOSE 80
|
||||||
COPY --from=builder /app ./
|
|
||||||
|
|
||||||
# Expose Vite preview port
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
EXPOSE 4173
|
|
||||||
|
|
||||||
# Run preview server
|
|
||||||
CMD ["npm", "run", "preview", "--", "--host"]
|
|
||||||
Reference in New Issue
Block a user