diff options
author | hy <hyang@hyang.xyz> | 2023-09-09 19:48:51 -0700 |
---|---|---|
committer | hy <hyang@hyang.xyz> | 2023-09-09 19:48:51 -0700 |
commit | 41c0525f5ef6317fc7da1ee4c8b367b66bff4be6 (patch) | |
tree | a7aff6f0d9c3f40bdd49de2fb298b1c7006d6322 | |
parent | ecbe7fdcec4744c74ad5089a2764706c2af708af (diff) |
Add git watcher
-rw-r--r-- | Dockerfile | 8 | ||||
-rwxr-xr-x | watch.sh | 7 |
2 files changed, 13 insertions, 2 deletions
@@ -2,8 +2,12 @@ FROM alpine:latest RUN apk add --no-cache hugo git +COPY . /app + WORKDIR /app -EXPOSE 1313/tcp +RUN ./watch.sh & + +EXPOSE 443/tcp -ENTRYPOINT (git clone "$REPO" . || git fetch && git reset --hard origin) && git submodule update --init --remote && hugo serve --baseURL "$BASE_URL" -p "$PORT" --bind '0.0.0.0' -e "$HUGO_ENV" --disableFastRender --disableLiveReload +ENTRYPOINT hugo serve --baseURL "$BASE_URL" -p "$PORT" --bind '0.0.0.0' -e "$HUGO_ENV" --disableFastRender --disableLiveReload diff --git a/watch.sh b/watch.sh new file mode 100755 index 0000000..ddf88f9 --- /dev/null +++ b/watch.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +while true; do + git fetch && git reset --hard origin + sleep 60 +done + |