docker: corriger copie start-4nk-node.sh et config nginx; servir dist/ proprement

This commit is contained in:
Your Name 2025-08-26 06:12:15 +02:00
parent 9841c5a425
commit 8f478db247
2 changed files with 18 additions and 5 deletions

View File

@ -44,14 +44,11 @@ RUN apk update && apk add --no-cache nodejs npm wget
COPY --from=builder /app/dist /usr/share/nginx/html
COPY --from=builder /app/package*.json /app/
# Index HTML minimal chargeant le bundle
RUN printf '<!doctype html>\n<html lang="fr">\n<head>\n <meta charset="UTF-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1.0" />\n <title>4NK UI</title>\n</head>\n<body>\n <div id="app"></div>\n <script type="module" src="/index.js"></script>\n</body>\n</html>\n' > /usr/share/nginx/html/index.html
# Copie de la configuration nginx optimisée pour 4NK_node
# Copie de la configuration nginx
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Script de démarrage
COPY start.sh /start-4nk-node.sh
COPY start-4nk-node.sh /start-4nk-node.sh
RUN chmod +x /start-4nk-node.sh
# Exposition des ports

16
nginx.conf Normal file
View File

@ -0,0 +1,16 @@
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|webp|wasm)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
}