Skip to content

Commit

Permalink
Merge pull request #25 from ScilifelabDataCentre/sebbe-pre-dev_branch
Browse files Browse the repository at this point in the history
Fixed Routing issue, making it possible to load page routes directly without going through the index page
  • Loading branch information
SevLG authored Feb 12, 2024
2 parents d983348 + c313f37 commit c79c41a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@
/react-app/npm-debug.log*
/react-app/yarn-debug.log*
/react-app/yarn-error.log*
react-app/public/.DS_Store
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ COPY ./react-app/ .
RUN npm run build

FROM nginxinc/nginx-unprivileged:stable-alpine
RUN sed -i '3 a\ absolute_redirect off;' /etc/nginx/conf.d/default.conf
RUN sed -i 's/#error_page 404/error_page 404/' /etc/nginx/conf.d/default.conf
USER 101
COPY ./conf/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/build /usr/share/nginx/html
EXPOSE 8080
CMD ["nginx", "-g", "daemon off;"]
8 changes: 8 additions & 0 deletions conf/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
server {
listen 8080;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
}

0 comments on commit c79c41a

Please sign in to comment.