From d1425f4f7dae1f4ebb0cbad4bfed7f2297af72d2 Mon Sep 17 00:00:00 2001 From: eddy Date: Thu, 9 Apr 2026 15:47:13 +0200 Subject: [PATCH] dockerfile nginx --- Dockerfile | 5 +---- nginx.conf | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile index 0ea2801..4964fc0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,16 +8,13 @@ RUN npm install COPY . . -# wichtig für API URL -ARG VITE_API_URL -ENV VITE_API_URL=$VITE_API_URL - RUN npm run build # Serve Stage FROM nginx:alpine COPY --from=build /app/dist /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..9021112 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,15 @@ +server { + listen 80; + + location / { + root /usr/share/nginx/html; + index index.html; + try_files $uri $uri/ /index.html; + } + + location /api { + proxy_pass https://restapi.testsite.deinedorfapp.de; + proxy_set_header Host restapi.testsite.deinedorfapp.de; + proxy_set_header X-Real-IP $remote_addr; + } +} \ No newline at end of file