Commit df6e6207 authored by jcorvi's avatar jcorvi
Browse files

Merge branch 'develop' into 'master'

Develop

See merge request !26
parents fb2e3b67 0abe60a6
Pipeline #28512 passed with stage
in 1 minute and 11 seconds
......@@ -8,19 +8,32 @@ RUN npm update
COPY . .
COPY src/assets/index.template.html src/index.html
#RUN npm run build --prod
RUN ./node_modules/.bin/ng build --prod --base-href /pretox/
RUN ./node_modules/.bin/ng build --prod --base-href /pretoxtm.kh.svc/
### STAGE 2: Run ###
FROM nginx:1.17.1-alpine
FROM nginx:1.21.6-alpine
#fix refresh
#https://makinhs.medium.com/for-some-folks-who-will-get-in-trouble-with-refresh-the-angular-page-and-get-a-404-2cf394b5dac6
RUN rm -rf /usr/share/nginx/html/* && rm -rf /etc/nginx/nginx.conf
COPY ./nginx.conf /etc/nginx/nginx.conf
COPY --from=build /usr/src/app/dist/my-app /usr/share/nginx/html/pretox
COPY --from=build /usr/src/app/dist/my-app /usr/share/nginx/html
COPY src/manage /usr/share/nginx/html/manage
RUN apk add util-linux
RUN cp /usr/share/nginx/html/manage/v1/api.template /usr/share/nginx/html/manage/v1/api
RUN sed -i "s/{RELEASE_DATE}/$(date +%F)/g" /usr/share/nginx/html/manage/v1/api
RUN sed -i "s/{APP_VERSION}/2.0/g" /usr/share/nginx/html/manage/v1/api
RUN sed -i "s/{UUID}/$(uuidgen)/g" /usr/share/nginx/html/manage/v1/api
RUN rm /usr/share/nginx/html/manage/v1/api.template
#CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/pretox/assets/env.template.js > /usr/share/nginx/html/pretox/assets/env.js && exec nginx -g 'daemon off;'"]
CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/pretox/assets/env.template.js > /usr/share/nginx/html/pretox/assets/env.js && envsubst < /usr/share/nginx/html/pretox/index.html > /usr/share/nginx/html/pretox/index.html_2 && cp /usr/share/nginx/html/pretox/index.html_2 /usr/share/nginx/html/pretox/index.html && exec nginx -g 'daemon off;'"]
#CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/pretox/assets/index.template.html > /usr/share/nginx/html/pretox/index.html && exec nginx -g 'daemon off;'"]
CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/assets/env.template.js > /usr/share/nginx/html/assets/env.js && envsubst < /usr/share/nginx/html/index.html > /usr/share/nginx/html/index.html_2 && cp /usr/share/nginx/html/index.html_2 /usr/share/nginx/html/index.html && exec nginx-debug -g 'daemon off;'"]
#CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/pretox/assets/env.template.js > /usr/share/nginx/html/pretox/assets/env.js && envsubst < /usr/share/nginx/html/pretox/index.html > /usr/share/nginx/html/pretox/index.html_2 && cp /usr/share/nginx/html/pretox/index.html_2 /usr/share/nginx/html/pretox/index.html && exec nginx-debug -g 'daemon off;'"]
#CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/pretox/assets/index.template.html > /usr/share/nginx/html/pretox/index.html && exec nginx -g 'daemon off;'"]
# && exec nginx-debug -g 'daemon off;'
#FROM nginx:1.17.1-alpine
#COPY /dist/my-app /usr/share/nginx/html
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment