prod127ac/sureops/prod127ac-front1-f/deployment/Dockerfile

30 lines
1.1 KiB
Docker
Raw Normal View History

2024-08-23 10:20:50 +00:00
# Git clone
FROM alpine/git:v2.30.1 AS code
ARG BUILD_ID
ARG GITEA_USER
ARG GITEA_PASS
RUN echo $BUILD_ID
LABEL stage=builder
LABEL build_id=$BUILD_ID
RUN mkdir repo
WORKDIR /repo
RUN git clone http://$GITEA_USER:$GITEA_PASS@git.io8.dev/risadmin_prod/prod127ac.git
# angular build
FROM node:16.20.2-alpine3.18 as build
LABEL stage=app
LABEL build_id=$BUILD_ID
WORKDIR /usr/src/app
COPY --from=code /repo/prod127ac/prod127ac-front1-f/authsec_angular/frontend/angular-clarity-master/package.json /repo/prod127ac/prod127ac-front1-f/authsec_angular/frontend/angular-clarity-master/package-lock.json ./
RUN npm install
COPY --from=code /repo/prod127ac/prod127ac-front1-f/authsec_angular/frontend/angular-clarity-master .
ENV NODE_OPTIONS="--max_old_space_size=4096"
RUN npm run build
# configuring nginx web-server
FROM nginx:1.17.1-alpine
#COPY --from=code /repo/cns-beta/springboot/angular-clarity-master/angular-clarity-master/default.conf /etc/nginx/conf.d/default.conf
COPY --from=build /usr/src/app/dist /usr/share/nginx/html
#RUN ls -a /usr/share/nginx/html/
EXPOSE 80