DONE: cicd pipeline for frontend that uses ip first
This commit is contained in:
@@ -1,10 +1,21 @@
|
||||
FROM node:21-alpine AS build
|
||||
WORKDIR /admin-app
|
||||
COPY package*.json .
|
||||
RUN npm install
|
||||
# Build stage
|
||||
FROM node:20-bookworm AS build
|
||||
WORKDIR /app
|
||||
|
||||
ARG VITE_API_URL=http://localhost:8080
|
||||
ARG VITE_CUSTOMER_APP_URL=http://localhost:3000
|
||||
ENV VITE_API_URL=$VITE_API_URL
|
||||
ENV VITE_CUSTOMER_APP_URL=$VITE_CUSTOMER_APP_URL
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
EXPOSE 5001
|
||||
CMD ["npm", "run", "preview"]
|
||||
# Runtime stage — static SPA
|
||||
FROM nginx:alpine
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
Reference in New Issue
Block a user