24 lines
426 B
Docker
24 lines
426 B
Docker
# Stage 1: Build the Vue App
|
|
FROM node:22-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json ./
|
|
RUN npm install
|
|
|
|
COPY . .
|
|
RUN npm run build -- --force
|
|
|
|
|
|
# Stage 2: Serve the Built App Using Nginx
|
|
FROM nginx:alpine
|
|
|
|
WORKDIR /usr/share/nginx/html
|
|
RUN rm -rf ./*
|
|
COPY --from=builder /app/dist ./
|
|
|
|
# Nginx Config
|
|
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 80
|
|
CMD ["nginx", "-g", "daemon off;"]
|