diff --git a/.dockerignore b/.dockerignore index ef728e87..9867f1ba 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,8 +1,12 @@ -*~ -.vscode/ -.git/ -.github/ -.tmp/ -resources/ -public/ +.gitignore +.git +.github +LICENSE +README.md + +bin/build.sh +bin/watch.sh +src/public +src/resources +src/.hugo_build.lock node_modules/ diff --git a/.gitignore b/.gitignore index f6c8e83a..afae6c3b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,10 @@ dist/ -src/resources/_gen -src/public/ +src/resources +src/public +src/.hugo_build.lock src/i18n/* node_modules/ .DS_Store -.hugo_build.lock *.log # Ignore all i18n sub-directories apart from en. @@ -18,4 +18,4 @@ src/content/pl src/content/pt src/content/ru src/content/tr -src/content/zh \ No newline at end of file +src/content/zh diff --git a/Dockerfile b/Dockerfile index f95f1616..46830568 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -# builder image +# Build image FROM alpine:latest ARG HUGO_BASEURL @@ -22,7 +22,9 @@ COPY ./ /root/ RUN bin/build-hugo.sh -# final image +# Serve image (stable nginx version) +# This cannot use Alpine because test/Dockerfile builds on this image and +# expects it to have apt-get. FROM nginx:1.22 LABEL description="dcrweb server" diff --git a/conf/nginx.conf b/conf/nginx.conf index 9d0321f1..a2f30335 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -13,13 +13,15 @@ server { server_name localhost; charset utf-8; + + # Hide Version server_tokens off; - - #Security Headers - add_header X-Content-Type-Options "nosniff" always; - add_header X-Frame-Options "DENY" always; - add_header X-XSS-Protection "1; mode=block" always; - add_header Referrer-Policy "no-referrer" always; + + # Security Headers + add_header X-Content-Type-Options "nosniff" always; + add_header X-Frame-Options "DENY" always; + add_header X-XSS-Protection "1; mode=block" always; + add_header Referrer-Policy "no-referrer" always; location /base58 { if ($arg_go-get = "1") { @@ -135,7 +137,7 @@ server { gzip_comp_level 6; gzip_buffers 16 8k; gzip_http_version 1.1; - gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss image/svg+xml text/javascript; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/rss+xml image/svg+xml text/javascript; # Redirection for dcrweb pages which no longer exist. rewrite ^/roadmap/?$ $scheme://$http_host/ permanent;