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