Dockerfile
This commit is contained in:
parent
5ef5b3e08f
commit
c68e6c9303
18
Dockerfile
18
Dockerfile
@ -1,20 +1,12 @@
|
|||||||
# Step 1: Build the app
|
# Use official Nginx image
|
||||||
FROM node:20-alpine as builder
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
RUN npm install && npm run build
|
|
||||||
|
|
||||||
# Step 2: Serve it with Nginx
|
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
|
|
||||||
# Remove default content
|
# Remove default Nginx web files
|
||||||
RUN rm -rf /usr/share/nginx/html/*
|
RUN rm -rf /usr/share/nginx/html/*
|
||||||
|
|
||||||
# Copy built files from the previous stage
|
# Copy all your static site files into the Nginx web directory
|
||||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
COPY . /usr/share/nginx/html
|
||||||
|
|
||||||
|
# Expose port 80
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user