From b077a91f64ca0955a280fc0e6da041c669936441 Mon Sep 17 00:00:00 2001 From: Luchesar ILIEV Date: Thu, 5 Dec 2024 17:48:20 +0200 Subject: [PATCH] ops: allow React routing --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 645e49e..d8734fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,10 +12,14 @@ 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. +RUN sed -Ei \ + '/\s*location\s+\/\s+\{\s*$/a \ try_files $uri /index.html;' \ + /etc/nginx/conf.d/default.conf + COPY --from=requirements-stage /tmp/dist /usr/share/nginx/html