Self-host the web app with Docker; publish the image to ghcr.io (#2033)
Thanks @rpromas.
This commit is contained in:
1 parent
4a70c03deb
commit
6597ffe072
7 files changed
+282
No files matched your search
@@ -0,0 +1,33 @@
|
||||
# The SolidCraft web app (packaging/docker/Dockerfile).
|
||||
#
|
||||
# Caching follows the app's update check (xtask/src/web_offline.rs): index.html, sw.js and
|
||||
# build.json must always be asked for again, or browsers keep an old build; Trunk's hashed
|
||||
# files (filehash = true) never change and are kept for a year.
|
||||
server {
|
||||
listen 8080;
|
||||
server_name _;
|
||||
server_tokens off;
|
||||
root /srv/solidcraft;
|
||||
index index.html;
|
||||
|
||||
gzip on;
|
||||
gzip_min_length 1024;
|
||||
gzip_types application/wasm application/javascript text/css application/json application/manifest+json image/svg+xml font/ttf;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
add_header Cache-Control "no-cache" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
}
|
||||
|
||||
location ~ "-[0-9a-f]{16}(_bg)?\.(js|wasm|css)$" {
|
||||
add_header Cache-Control "public, max-age=31536000, immutable" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
}
|
||||
|
||||
location ~ \.webmanifest$ {
|
||||
default_type application/manifest+json;
|
||||
add_header Cache-Control "no-cache" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user