diff options
author | crupest <crupest@outlook.com> | 2022-11-30 19:07:56 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-11-30 19:07:56 +0800 |
commit | 2c7db65ebe8314e153e2d273f7f74a12d328e650 (patch) | |
tree | 57ac65accf7da8f6986edb40ee01078e528a40ae | |
parent | b2fb84b577467ca7b0fc7139a7ad50c24c434d18 (diff) | |
download | crupest-2c7db65ebe8314e153e2d273f7f74a12d328e650.tar.gz crupest-2c7db65ebe8314e153e2d273f7f74a12d328e650.tar.bz2 crupest-2c7db65ebe8314e153e2d273f7f74a12d328e650.zip |
Make hugo generate to another dir out of git.
-rw-r--r-- | docker/crupest-blog/Dockerfile | 2 | ||||
-rwxr-xr-x | docker/crupest-blog/update.bash | 4 | ||||
-rw-r--r-- | template/docker-compose.yaml.template | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/docker/crupest-blog/Dockerfile b/docker/crupest-blog/Dockerfile index e2b27a5..b5dd273 100644 --- a/docker/crupest-blog/Dockerfile +++ b/docker/crupest-blog/Dockerfile @@ -4,6 +4,6 @@ ARG CRUPEST_BLOG_UPDATE_INTERVAL=1d RUN apk add --no-cache coreutils tini bash git ENV CRUPEST_BLOG_UPDATE_INTERVAL=${CRUPEST_BLOG_UPDATE_INTERVAL} COPY daemon.bash update.bash / -VOLUME [ "/blog/public" ] +VOLUME [ "/public" ] ENTRYPOINT ["/sbin/tini", "--"] CMD [ "/daemon.bash" ] diff --git a/docker/crupest-blog/update.bash b/docker/crupest-blog/update.bash index f4ac51b..d4bcadc 100755 --- a/docker/crupest-blog/update.bash +++ b/docker/crupest-blog/update.bash @@ -5,6 +5,8 @@ set -e echo -e "\e[0;103m\e[K\e[1mBegin to build blog...\e[0m" echo "Begin time: $(date +%Y-%m-%dT%H:%M:%SZ)" +mkdir -p /public + # check /blog directory exists if [[ ! -d /blog ]]; then echo "Directory /blog not found, clone blog repository..." @@ -21,7 +23,7 @@ fi # Now hugo it echo "Run hugo to generate blog..." -hugo +hugo -d /public echo "Finish time: $(date +%Y-%m-%dT%H:%M:%SZ)" echo -e "\e[0;102m\e[K\e[1mFinish build!\e[0m" diff --git a/template/docker-compose.yaml.template b/template/docker-compose.yaml.template index e6a43e9..083911d 100644 --- a/template/docker-compose.yaml.template +++ b/template/docker-compose.yaml.template @@ -38,7 +38,7 @@ services: container_name: crupest-blog restart: on-failure:3 volumes: - - "blog-public:/blog" + - "blog-public:/public" nginx: pull_policy: build |