47 lines
1.3 KiB
Docker
47 lines
1.3 KiB
Docker
|
# Git clone stage
|
||
|
FROM farhan23432/ris_git:2.30.1 AS code
|
||
|
ARG BUILD_ID
|
||
|
RUN echo $BUILD_ID
|
||
|
LABEL stage=builder
|
||
|
LABEL build_id=$BUILD_ID
|
||
|
RUN mkdir /repo
|
||
|
WORKDIR /repo
|
||
|
ARG PAT_TOKEN
|
||
|
ENV PAT_TOKEN=$PAT_TOKEN
|
||
|
|
||
|
RUN git clone http://$GITEA_USER:$GITEA_PASS@git.io8.dev/risadmin_prod/prod127vjs.git
|
||
|
|
||
|
# Node.js stage
|
||
|
FROM node:lts-alpine as build
|
||
|
LABEL stage=builder
|
||
|
LABEL build_id=$BUILD_ID
|
||
|
WORKDIR /usr/src/app
|
||
|
|
||
|
# Copy package.json and package-lock.json to the working directory
|
||
|
COPY --from=code /repo/prod127vjs/prod127vjs-front-f/Authsec_vuejs/Authsec_vuejs/package*.json ./
|
||
|
|
||
|
# Install app dependencies
|
||
|
RUN npm install --force
|
||
|
|
||
|
# Copy the entire contents of the Backend directory
|
||
|
COPY --from=code /repo/prod127vjs/prod127vjs-front-f/Authsec_vuejs/Authsec_vuejs .
|
||
|
|
||
|
# Build the Vue.js application
|
||
|
#RUN PUBLIC_URL=http://13.200.171.124:30473/prod127vjs24734/front npm run build
|
||
|
RUN npm install -g vite
|
||
|
RUN vite build --base=http://13.200.171.124:30473/prod127vjs24734/front
|
||
|
|
||
|
# Production stage to serve the built application
|
||
|
FROM nginx:alpine
|
||
|
LABEL stage=production
|
||
|
LABEL build_id=$BUILD_ID
|
||
|
|
||
|
# Copy the built application from the build stage
|
||
|
COPY --from=build /usr/src/app/dist /usr/share/nginx/html
|
||
|
|
||
|
# Expose port 80
|
||
|
EXPOSE 80
|
||
|
|
||
|
# Command to run the Nginx server
|
||
|
CMD ["nginx", "-g", "daemon off;"]
|