update dockerfile

This commit is contained in:
rheiga19 2025-03-26 23:24:01 +07:00
parent a8d825c573
commit c590466247
1 changed files with 12 additions and 9 deletions

View File

@ -13,16 +13,19 @@ RUN npm install
COPY . .
# Build the project
RUN npm run build
RUN npm run start
# Use Nginx for serving static files
FROM nginx:alpine
# Final stage
FROM node:18-alpine
# Copy build files to Nginx html directory
COPY --from=builder /app/dist /usr/share/nginx/html
# Set working directory
WORKDIR /app
# Expose port 80
EXPOSE 80
# Copy built files from builder
COPY --from=builder /app ./
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]
# Expose the application port (sesuaikan dengan port yang digunakan di package.json)
EXPOSE 4173
# Jalankan aplikasi dengan npm run preview
CMD ["npm", "run", "preview"]