File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,6 @@ RUN yarn build --mode ${BUILD_MODE}
88
99FROM nginx:1.21
1010ADD ./default.conf /etc/nginx/conf.d/default.conf
11+ ADD ./docker_entrypoint.sh /docker_entrypoint.sh
1112COPY --from=build /app/dist /usr/share/nginx/html
12- RUN export APPJS_NAME=$(cd /usr/share/nginx/html && ls js/app.*.js) \
13- && sed -i 's|APPJS_NAME|' ${APPJS_NAME}'|g' /etc/nginx/conf.d/default.conf
13+ RUN chmod +x /docker_entrypoint.sh && /docker_entrypoint.sh
Original file line number Diff line number Diff line change @@ -9,12 +9,12 @@ server {
99 try_files $uri /index.html;
1010 }
1111
12- location /js/app.js {
13- return 302 https://$host/APPJS_NAME;
14- }
12+ # location /js/app.js {
13+ # return 302 https://$host/APPJS_NAME;
14+ # }
1515
1616 error_page 500 502 503 504 /50x.html;
1717 location = /50x.html {
1818 root /usr/share/nginx/html;
1919 }
20- }
20+ }
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ export APPJS_NAME=$( cd /usr/share/nginx/html && ls js/app.* .js)
4+ if [ ! -z ${APPJS_NAME} ]
5+ then
6+ echo ' app.js is ${APPJS_NAME}'
7+ sed -i ' s|APPJS_NAME|' ${APPJS_NAME} ' |g' /etc/nginx/conf.d/default.conf
8+ sed -i ' s|# ||g' /etc/nginx/conf.d/default.conf
9+ else
10+ echo ' app.js is app.js, no changes'
11+ fi
You can’t perform that action at this time.
0 commit comments