fix redirect bug
All checks were successful
Build, Publish Docker Image, and Deploy to Kubernetes / build_and_push (push) Successful in 15s
Build, Publish Docker Image, and Deploy to Kubernetes / deploy_to_k8s (push) Successful in 14s

This commit is contained in:
Jonas Hinterdorfer 2025-07-10 19:38:35 +02:00
parent 7c94d7a38b
commit 83518e2b3e
2 changed files with 21 additions and 1 deletions

View File

@ -9,5 +9,6 @@ RUN npm run build
# Production stage
FROM nginx:alpine
COPY --from=build /app/build /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
CMD ["nginx", "-g", "daemon off;"]

19
nginx.conf Normal file
View File

@ -0,0 +1,19 @@
# nginx.conf
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri /index.html;
}
# Optional: serve static files directly
location ~* \.(js|css|png|jpg|jpeg|gif|svg|ico|woff2?|ttf|eot|otf|ttc|json)$ {
try_files $uri =404;
access_log off;
add_header Cache-Control "public, max-age=31536000, immutable";
}
}