Browse Source

docker: for better maintenance

pull/4204/head
pexcn 2 years ago
parent
commit
5c4d1ec035
  1. 5
      .github/workflows/dockerhub.yml
  2. 9
      docker/Dockerfile
  3. 9
      docker/entry.sh

5
.github/workflows/dockerhub.yml

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

9
Dockerfile → docker/Dockerfile

@ -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} \
; done
RUN printf "%b" '#!'"/usr/bin/env sh\n \
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
COPY entry.sh /
VOLUME /acme.sh

9
docker/entry.sh

@ -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
Loading…
Cancel
Save