docker: Create entrypoint script (fixes #5631) (#5635)

This commit is contained in:
Tom Jakubowski 2019-05-17 23:43:53 -07:00 committed by Jakob Borg
parent 441ea109a1
commit cc36621b11
2 changed files with 10 additions and 7 deletions

View File

@ -17,16 +17,11 @@ VOLUME ["/var/syncthing"]
RUN apk add --no-cache ca-certificates su-exec
COPY --from=builder /src/syncthing /bin/syncthing
COPY --from=builder /src/script/docker-entrypoint.sh /bin/entrypoint.sh
ENV PUID=1000 PGID=1000
HEALTHCHECK --interval=1m --timeout=10s \
CMD nc -z localhost 8384 || exit 1
ENTRYPOINT \
chown "${PUID}:${PGID}" /var/syncthing \
&& su-exec "${PUID}:${PGID}" \
env HOME=/var/syncthing \
/bin/syncthing \
-home /var/syncthing/config \
-gui-address 0.0.0.0:8384
ENTRYPOINT ["/bin/entrypoint.sh", "-home", "/var/syncthing/config", "-gui-address", "0.0.0.0:8384"]

8
script/docker-entrypoint.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
set -eu
chown "${PUID}:${PGID}" /var/syncthing \
&& exec su-exec "${PUID}:${PGID}" \
env HOME=/var/syncthing \
/bin/syncthing "$@"