ci changes
This commit is contained in:
parent
f30392864c
commit
3a27f66dc5
|
@ -12,7 +12,7 @@ RUN npm install
|
|||
COPY . /page
|
||||
|
||||
# Build the project and copy the files
|
||||
RUN npm run ng build -- --deploy-url=/ --prod
|
||||
RUN npm run ng build -- --prod
|
||||
|
||||
FROM nginx:alpine
|
||||
|
||||
|
|
|
@ -12,20 +12,24 @@ WORKDIR /src
|
|||
COPY . .
|
||||
|
||||
# Build the project and copy the files
|
||||
RUN npm run ng build -- --deploy-url=/ --prod
|
||||
RUN npm run ng build -- --prod
|
||||
#RUN node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build -- --deploy-url=/ --prod
|
||||
|
||||
FROM nginx:alpine
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
COPY nginx.conf.CI /etc/nginx/conf.d/default.conf
|
||||
COPY start_nginx.sh /start_nginx.sh
|
||||
RUN mkdir -p /tmp/log/nginx
|
||||
|
||||
|
||||
## Remove default nginx index page
|
||||
RUN rm -rf /usr/share/nginx/html/*
|
||||
|
||||
# Copy from the stahg 1
|
||||
# Copy from the stage 1
|
||||
COPY --from=builder /src/dist /usr/share/nginx/html
|
||||
RUN cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index_base.html
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENTRYPOINT ["nginx", "-g", "daemon off;"]
|
||||
ENTRYPOINT ["sh", "/start_nginx.sh"]
|
|
@ -22,6 +22,13 @@ server {
|
|||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html =404;
|
||||
}
|
||||
|
||||
location = /index.html {
|
||||
add_header Cache-Control "no-store, no-cache, must-revalidate";
|
||||
}
|
||||
|
||||
location = /assets/config.json {
|
||||
add_header Cache-Control "no-store, no-cache, must-revalidate";
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
if [[ ! -z "${WEBAPP_BASE_URL}" ]]; then
|
||||
rm /usr/share/nginx/html/index.html
|
||||
cp /usr/share/nginx/html/index_base.html /usr/share/nginx/html/index.html
|
||||
find '/usr/share/nginx/html' -name 'index.html' -exec sed -i -e 's,<base href="/">,<base href="'"$WEBAPP_BASE_URL"'">,g' {} \;
|
||||
fi
|
||||
|
||||
nginx -g "daemon off;"
|
Loading…
Reference in New Issue