fix(deploy): add spa fallback in frontend image

This commit is contained in:
2026-04-30 10:04:41 +03:30
parent a91606cc32
commit 0a328156fa

View File

@@ -13,6 +13,23 @@ RUN npm run build
FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html
# Internal Nginx configuration (Root Nginx acts as reverse proxy to this)
RUN cat <<'EOF' > /etc/nginx/conf.d/default.conf
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
location /assets/ {
try_files $uri =404;
access_log off;
expires 30d;
}
location / {
try_files $uri $uri/ /index.html;
}
}
EOF
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]