Skip to content

Commit

Permalink
docker: Create entrypoint script (fixes syncthing#5631) (syncthing#5635)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjakubowski authored and calmh committed May 18, 2019
1 parent 441ea10 commit cc36621
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 8 additions & 0 deletions script/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

set -eu

chown "${PUID}:${PGID}" /var/syncthing \
&& exec su-exec "${PUID}:${PGID}" \
env HOME=/var/syncthing \
/bin/syncthing "$@"

0 comments on commit cc36621

Please sign in to comment.