docker: for better maintenance

This commit is contained in:
pexcn 2022-07-25 16:55:09 +08:00
parent 5b8d7a3f29
commit 5c4d1ec035
3 changed files with 12 additions and 11 deletions

View File

@ -8,10 +8,9 @@ on:
- '*' - '*'
paths: paths:
- '**.sh' - '**.sh'
- "Dockerfile" - "docker/**"
- '.github/workflows/dockerhub.yml' - '.github/workflows/dockerhub.yml'
jobs: jobs:
CheckToken: CheckToken:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -30,7 +29,7 @@ jobs:
fi fi
- name: Check the value - name: Check the value
run: echo ${{ steps.step_one.outputs.hasToken }} run: echo ${{ steps.step_one.outputs.hasToken }}
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: CheckToken needs: CheckToken

View File

@ -62,14 +62,7 @@ RUN for verb in help \
printf -- "%b" "#!/usr/bin/env sh\n/root/.acme.sh/acme.sh --${verb} --config-home /acme.sh \"\$@\"" >/usr/local/bin/--${verb} && chmod +x /usr/local/bin/--${verb} \ printf -- "%b" "#!/usr/bin/env sh\n/root/.acme.sh/acme.sh --${verb} --config-home /acme.sh \"\$@\"" >/usr/local/bin/--${verb} && chmod +x /usr/local/bin/--${verb} \
; done ; done
RUN printf "%b" '#!'"/usr/bin/env sh\n \ COPY entry.sh /
if [ \"\$1\" = \"daemon\" ]; then \n \
trap \"echo stop && killall crond && exit 0\" SIGTERM SIGINT \n \
crond && sleep infinity &\n \
wait \n \
else \n \
exec -- \"\$@\"\n \
fi" >/entry.sh && chmod +x /entry.sh
VOLUME /acme.sh VOLUME /acme.sh

9
docker/entry.sh Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env sh
if [ "$1" = "daemon" ]; then
trap "echo stop && killall crond && exit 0" SIGTERM SIGINT
crond && sleep infinity &
wait
else
exec -- "$@"
fi