nginx + docker + compose

This commit is contained in:
2026-11-18 18:39:52 -05:00
parent 2b909823ce
commit 8381869c66
12 changed files with 90 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
.git
.gitignore
Dockerfile
compose.yaml
README.md
LICENSE
.DS_STORE
+7
View File
@@ -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
+20
View File
@@ -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

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

Before

Width:  |  Height:  |  Size: 728 B

After

Width:  |  Height:  |  Size: 728 B

View File
View File
+56
View File
@@ -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;
}
}