From 8381869c66c0e525787f228265b32bfa7e9afbae1dc1894b04b61c7d788d0fa3 Mon Sep 17 00:00:00 2001 From: whoswhip Date: Wed, 18 Nov 2026 18:39:52 -0500 Subject: [PATCH] nginx + docker + compose --- .dockerignore | 7 +++ Dockerfile | 7 +++ compose.yaml | 20 +++++++ .../hu/dj3498u4hyyarh35rkjfnghbjxug6b19 | Bin .../.well-known}/openpgpkey/policy | 0 .../assets}/FunnelSans-Regular.woff2 | Bin {assets => html/assets}/pfp-large.jpg | Bin {assets => html/assets}/pfp.webp | Bin .../pixelify-sans-regular-11px-square.woff2 | Bin index.html => html/index.html | 0 public.asc => html/public.asc | 0 nginx.conf | 56 ++++++++++++++++++ 12 files changed, 90 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 compose.yaml rename {.well-known => html/.well-known}/openpgpkey/hu/dj3498u4hyyarh35rkjfnghbjxug6b19 (100%) rename {.well-known => html/.well-known}/openpgpkey/policy (100%) rename {assets => html/assets}/FunnelSans-Regular.woff2 (100%) rename {assets => html/assets}/pfp-large.jpg (100%) rename {assets => html/assets}/pfp.webp (100%) rename {assets => html/assets}/pixelify-sans-regular-11px-square.woff2 (100%) rename index.html => html/index.html (100%) rename public.asc => html/public.asc (100%) create mode 100644 nginx.conf diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5f6fd84 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.git +.gitignore +Dockerfile +compose.yaml +README.md +LICENSE +.DS_STORE \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9b3de40 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ + +FROM nginxinc/nginx-unprivileged:stable-alpine + +COPY nginx.conf /etc/nginx/conf.d/default.conf +COPY html/ /usr/share/nginx/html/ + +EXPOSE 8080 diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..1da1a72 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,20 @@ + +services: + web: + build: . + image: whoswhip-dev:latest + restart: unless-stopped + + ports: + - "8080:8080" + + read_only: true + + tmpfs: + - /tmp:rw,nosuid,nodev,size=16m + + security_opt: + - no-new-privileges:true + + cap_drop: + - ALL diff --git a/.well-known/openpgpkey/hu/dj3498u4hyyarh35rkjfnghbjxug6b19 b/html/.well-known/openpgpkey/hu/dj3498u4hyyarh35rkjfnghbjxug6b19 similarity index 100% rename from .well-known/openpgpkey/hu/dj3498u4hyyarh35rkjfnghbjxug6b19 rename to html/.well-known/openpgpkey/hu/dj3498u4hyyarh35rkjfnghbjxug6b19 diff --git a/.well-known/openpgpkey/policy b/html/.well-known/openpgpkey/policy similarity index 100% rename from .well-known/openpgpkey/policy rename to html/.well-known/openpgpkey/policy diff --git a/assets/FunnelSans-Regular.woff2 b/html/assets/FunnelSans-Regular.woff2 similarity index 100% rename from assets/FunnelSans-Regular.woff2 rename to html/assets/FunnelSans-Regular.woff2 diff --git a/assets/pfp-large.jpg b/html/assets/pfp-large.jpg similarity index 100% rename from assets/pfp-large.jpg rename to html/assets/pfp-large.jpg diff --git a/assets/pfp.webp b/html/assets/pfp.webp similarity index 100% rename from assets/pfp.webp rename to html/assets/pfp.webp diff --git a/assets/pixelify-sans-regular-11px-square.woff2 b/html/assets/pixelify-sans-regular-11px-square.woff2 similarity index 100% rename from assets/pixelify-sans-regular-11px-square.woff2 rename to html/assets/pixelify-sans-regular-11px-square.woff2 diff --git a/index.html b/html/index.html similarity index 100% rename from index.html rename to html/index.html diff --git a/public.asc b/html/public.asc similarity index 100% rename from public.asc rename to html/public.asc diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..43b3828 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,56 @@ + +server { + listen 8080; + listen [::]:8080; + server_name _; + + root /usr/share/nginx/html; + index index.html; + + server_tokens off; + autoindex off; + + gzip on; + gzip_vary on; + gzip_comp_level 5; + gzip_min_length 1024; + gzip_types text/plain text/html; + + add_header X-Content-Type-Options "nosniff" always; + add_header Referrer-Policy "strict-origin-when-cross-origin" always; + + location = / { + add_header Cache-Control "no-cache"; + try_files /index.html =404; + } + + location = /public.asc { + default_type application/pgp-keys; + expires 1h; + try_files $uri =404; + } + + location ^~ /.well-known/openpgpkey/ { + types {} + default_type application/octet-stream; + + add_header Access-Control-Allow-Origin "*" always; + add_header X-Content-Type-Options "nosniff" always; + + expires 1h; + try_files $uri =404; + } + + location ~* ^/assets/.*\.(woff2|jpg|webp)$ { + expires 30d; + add_header Cache-Control "public" always; + add_header X-Content-Type-Options "nosniff" always; + + access_log off; + try_files $uri =404; + } + + location / { + return 404; + } +}