docker: corriger copie start-4nk-node.sh et config nginx; servir dist/ proprement
This commit is contained in:
parent
9841c5a425
commit
8f478db247
@ -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/dist /usr/share/nginx/html
|
||||||
COPY --from=builder /app/package*.json /app/
|
COPY --from=builder /app/package*.json /app/
|
||||||
|
|
||||||
# Index HTML minimal chargeant le bundle
|
# Copie de la configuration nginx
|
||||||
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
|
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
# Script de démarrage
|
# 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
|
RUN chmod +x /start-4nk-node.sh
|
||||||
|
|
||||||
# Exposition des ports
|
# Exposition des ports
|
||||||
|
16
nginx.conf
Normal file
16
nginx.conf
Normal 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";
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user