Добавил докер образ
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
export CONFIG_OUT="${CONFIG_OUT:-/usr/share/nginx/html/config.js}"
|
||||
|
||||
echo "Generating runtime config at ${CONFIG_OUT}..."
|
||||
node /docker/generate-config.js
|
||||
|
||||
exec nginx -g 'daemon off;'
|
||||
@@ -0,0 +1,32 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# SPA history mode
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
# Runtime config — always revalidate so env changes apply after restart
|
||||
location = /config.js {
|
||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
# Hashed assets — long cache
|
||||
location /assets/ {
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
# Service worker / workbox — always revalidate
|
||||
location ~* ^/(sw\.js|workbox-.*\.js)$ {
|
||||
add_header Cache-Control "no-cache";
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
gzip on;
|
||||
gzip_types text/css application/javascript application/json image/svg+xml;
|
||||
}
|
||||
Reference in New Issue
Block a user