docker: extract the vichan directory and make it optionally exposable

This commit is contained in:
Zankaria 2024-03-31 23:17:38 +02:00 committed by Zankaria
parent 6ba2c7cf42
commit df7d7e1d3c
6 changed files with 147 additions and 41 deletions

View file

@ -2,9 +2,7 @@ FROM nginx:1.25.3-alpine
COPY . /code
RUN adduser --system www-data \
&& adduser www-data www-data \
&& /code/docker/common-setup.sh
&& adduser www-data www-data
CMD [ "nginx", "-g", "daemon off;" ]
EXPOSE 80

View file

@ -6,7 +6,7 @@ server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name leftypol;
root /var/www;
root /var/www/html;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
@ -15,9 +15,24 @@ server {
charset utf-8;
location ~ ^([^.\?]*[^\/])$ {
try_files $uri @addslash;
try_files $uri @addslash;
}
# Expire rules for static content
# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
expires 1M;
access_log off;
log_not_found off;
add_header Cache-Control "public";
}
# CSS and Javascript
location ~* \.(?:css|js)$ {
expires 1y;
access_log off;
log_not_found off;
add_header Cache-Control "public";
}
# Expire rules for static content
# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
@ -39,7 +54,7 @@ server {
}
location @addslash {
return 301 $uri/;
return 301 $uri/;
}
location / {