update dockerfile
This commit is contained in:
parent
a8d825c573
commit
c590466247
|
|
@ -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"]
|
||||
|
|
|
|||
Loading…
Reference in New Issue