diff --git a/cnn_website/Dockerfile b/cnn_website/Dockerfile index a2aca04..d5fe057 100644 --- a/cnn_website/Dockerfile +++ b/cnn_website/Dockerfile @@ -1,29 +1,20 @@ -# Step 1: Build the app +# Step 1: Build FROM node:20-alpine AS builder WORKDIR /app -# Install dependencies COPY package*.json ./ RUN npm install -# Copy source code COPY . . - -# Build the project RUN npm run build -# Step 2: Run preview server -FROM node:20-alpine +# Step 2: Serve static files +FROM nginx:alpine -WORKDIR /app +COPY --from=builder /app/dist /usr/share/nginx/html -# Copy built files and node_modules (for vite preview) -COPY --from=builder /app ./ +EXPOSE 80 -# Expose Vite preview port -EXPOSE 4173 - -# Run preview server -CMD ["npm", "run", "preview", "--", "--host"] \ No newline at end of file +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file