From 3eb79fc9fdca5a5e7a5fb838743ffb83a4d24f87 Mon Sep 17 00:00:00 2001 From: Saleel Date: Fri, 13 Jan 2023 19:27:53 +0530 Subject: [PATCH] chore: add index.html redirects in Dockerfile of client and dashboard --- apps/client/Dockerfile | 2 ++ apps/dashboard/Dockerfile | 2 ++ nginx.conf | 13 +++++++++++++ 3 files changed, 17 insertions(+) create mode 100644 nginx.conf diff --git a/apps/client/Dockerfile b/apps/client/Dockerfile index 1059672..8a55151 100644 --- a/apps/client/Dockerfile +++ b/apps/client/Dockerfile @@ -13,6 +13,8 @@ RUN yarn build:all # Create image for the app by copying build artifacts from builder FROM nginx:stable-alpine as runner +RUN rm /etc/nginx/conf.d/default.conf +COPY ./nginx.conf /etc/nginx/conf.d COPY --from=builder /builder/dist/apps/client /usr/share/nginx/html EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] diff --git a/apps/dashboard/Dockerfile b/apps/dashboard/Dockerfile index 4f4f6ce..015d07d 100644 --- a/apps/dashboard/Dockerfile +++ b/apps/dashboard/Dockerfile @@ -13,6 +13,8 @@ RUN yarn build:all # Create image for the app by copying build artifacts from builder FROM nginx:stable-alpine as runner +RUN rm /etc/nginx/conf.d/default.conf +COPY ./nginx.conf /etc/nginx/conf.d COPY --from=builder /builder/dist/apps/dashboard /usr/share/nginx/html EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..2bddb9f --- /dev/null +++ b/nginx.conf @@ -0,0 +1,13 @@ +server { + listen 80; + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } + error_page 404 /index.html; + location = / { + root /usr/share/nginx/html; + internal; + } + } \ No newline at end of file