diff --git a/docker/build.sh b/docker/build.sh new file mode 100755 index 0000000..9e5b88f --- /dev/null +++ b/docker/build.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +docker container rm notes-server +docker build --no-cache -t notes-server . diff --git a/docker/install.sh b/docker/install.sh index 0ab8574..9ffc8d9 100755 --- a/docker/install.sh +++ b/docker/install.sh @@ -6,7 +6,7 @@ docker build --no-cache -t notes-server . # Run the notes-server image. docker run -d \ --name notes-server \ - -v "/var/www/html/notes/hugo/public:/usr/share/nginx/html" \ + -v "${PWD}/../hugo/public:/usr/share/nginx/html" \ -p 42069:80 \ notes-server diff --git a/docker/nginx.conf b/docker/nginx.conf index 2595c9a..0528892 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -2,8 +2,15 @@ server { listen 80 default_server; root "/usr/share/nginx/html"; + error_page 404 404.html; + location / { auth_basic "Restricted"; auth_basic_user_file auth.htpasswd; } + + # Disable authentication for certbot challenge dir. + location /.well-known/acme-challenge/ { + auth_basic off; + } } diff --git a/docker/run.sh b/docker/run.sh new file mode 100755 index 0000000..f6e5b31 --- /dev/null +++ b/docker/run.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Run the notes-server image. +docker run \ + --name notes-server \ + -v "${PWD}/../hugo/public:/usr/share/nginx/html" \ + -p 42069:80 \ + notes-server +