Skip to content

Commit

Permalink
ops: allow React routing (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
kerberizer authored Dec 5, 2024
2 parents 1696203 + c7015c0 commit 80bd694
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,17 @@ COPY ./public /tmp/public
COPY ./src /tmp/src

RUN npm install
#RUN npm run lint
RUN npm run build-docker


FROM nginx:mainline

# 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;' \
"${configfile}" && \
printf "${confighash}" | md5sum --check --status - && exit 1 || true

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

0 comments on commit 80bd694

Please sign in to comment.