dockerfile: Incorporate exposed ports, add volume (#4908)

Added EXPOSE to Dockerfile. this way these ports will show up in docker GUIs like cockpit.
Added VOLUME parameter, this renders creating the folder (/var/syncthing) obsolete.
This commit is contained in:
Nils Jakobi 2018-05-05 10:28:19 +02:00 committed by Jakob Borg
parent c9c2e69f49
commit f5d8243f15
1 changed files with 4 additions and 1 deletions

View File

@ -10,13 +10,16 @@ RUN rm -f syncthing && go run build.go build syncthing
FROM alpine
EXPOSE 8384 22000 21027/udp
VOLUME ["/var/syncthing"]
RUN apk add --no-cache ca-certificates
COPY --from=builder /go/src/github.com/syncthing/syncthing/syncthing /bin/syncthing
RUN echo 'syncthing:x:1000:1000::/var/syncthing:/sbin/nologin' >> /etc/passwd \
&& echo 'syncthing:!::0:::::' >> /etc/shadow \
&& mkdir /var/syncthing \
&& chown syncthing /var/syncthing
USER syncthing