Skip to content

Commit

Permalink
ops: also check if nginx config was actually modified
Browse files Browse the repository at this point in the history
  • Loading branch information
kerberizer committed Dec 5, 2024
1 parent b077a91 commit c7015c0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ RUN npm run build-docker

FROM nginx:mainline

# Allow React routing.
RUN sed -Ei \
# Allow React routing. Fail if the configuration file is not modified.
RUN configfile="/etc/nginx/conf.d/default.conf"; \
confighash="$(md5sum "${configfile}")"; \
sed -Ei \
'/\s*location\s+\/\s+\{\s*$/a \ try_files $uri /index.html;' \
/etc/nginx/conf.d/default.conf
"${configfile}" && \
printf "${confighash}" | md5sum --check --status - && exit 1 || true

COPY --from=requirements-stage /tmp/dist /usr/share/nginx/html

0 comments on commit c7015c0

Please sign in to comment.