Add nginx stage for Docker build
Co-authored-by: coolestcoder655 <74312880+coolestcoder655@users.noreply.github.com>
This commit is contained in:
14
Dockerfile
14
Dockerfile
@@ -1,4 +1,6 @@
|
||||
FROM node:22
|
||||
FROM node:22 AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package*.json
|
||||
COPY package*.json .
|
||||
@@ -11,3 +13,13 @@ COPY . .
|
||||
|
||||
# Build the application
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:alpine
|
||||
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
Reference in New Issue
Block a user