From 057927e835b7b49e3e9b17682fa1065764a31a4a Mon Sep 17 00:00:00 2001 From: valentinkolb Date: Mon, 13 May 2024 20:33:17 +0200 Subject: [PATCH] fix(docker): added nginx config and added webhook to cicd --- .gitea/workflows/cicd.yml | 4 ++-- Dockerfile | 3 ++- nginx/nginx.conf | 12 ++++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 nginx/nginx.conf diff --git a/.gitea/workflows/cicd.yml b/.gitea/workflows/cicd.yml index b920c94..5172877 100644 --- a/.gitea/workflows/cicd.yml +++ b/.gitea/workflows/cicd.yml @@ -28,5 +28,5 @@ jobs: push: true tags: git.stuve.uni-ulm.de/stuve-it/stuve-it-frontend:latest - # - name: Trigger webhook - # run: curl -X POST ${{ secrets.WEBHOOK_URL }} \ No newline at end of file + - name: Trigger webhook + run: curl -X POST ${{ secrets.WEB HOOK_URL }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 4eedf66..aae4a8b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,8 +22,9 @@ COPY --from=build /app/dist /usr/share/nginx/html #copy public folder COPY --from=build /app/public /usr/share/nginx/html -#copy allowed mime types +#copy allowed mime types and nginx config COPY ./nginx/mime.types /etc/nginx/mime.types +COPY ./nginx/nginx.conf /etc/nginx/nginx.conf # Expose port 80 to access the app EXPOSE 80 diff --git a/nginx/nginx.conf b/nginx/nginx.conf new file mode 100644 index 0000000..a294bbc --- /dev/null +++ b/nginx/nginx.conf @@ -0,0 +1,12 @@ +server { + listen 80; + + root /usr/share/nginx/html; # The root directory of your static files + index index.html; # The default index file + + location / { + try_files $uri $uri/ /index.html; # Try to serve the requested file or fallback to /index.html (React Router) + } + + error_log /var/log/nginx/error.log; +} \ No newline at end of file