Skip to content

Commit

Permalink
build: Docker cleanup/update.
Browse files Browse the repository at this point in the history
- Fix MIME type for rss feeds.
- Clean up .gitignore and .dockerignore.
  • Loading branch information
jholdstock authored and dajohi committed Mar 24, 2023
1 parent 4f33578 commit e124005
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 20 deletions.
18 changes: 11 additions & 7 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -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/
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -18,4 +18,4 @@ src/content/pl
src/content/pt
src/content/ru
src/content/tr
src/content/zh
src/content/zh
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# builder image
# Build image
FROM alpine:latest

ARG HUGO_BASEURL
Expand All @@ -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"
Expand Down
16 changes: 9 additions & 7 deletions conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e124005

Please sign in to comment.