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