dockerfile nginx

This commit is contained in:
2026-04-09 15:47:13 +02:00
parent 40ee18fc01
commit d1425f4f7d
2 changed files with 16 additions and 4 deletions

View File

@@ -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

15
nginx.conf Normal file
View File

@@ -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;
}
}