Syncthing cleanup
parent
134183029f
commit
38966e4a63
|
@ -8,19 +8,33 @@ LABEL maintiner="Mark <mark@betalupi.com>"
|
||||||
# The package will create its own syncthing user if one does not exist.
|
# The package will create its own syncthing user if one does not exist.
|
||||||
# We need to do it manually, to control uid and gid.
|
# We need to do it manually, to control uid and gid.
|
||||||
|
|
||||||
RUN groupadd -g 1000 syncthing && \
|
ARG ST_GID="1000"
|
||||||
useradd -g 1000 -u 1000 syncthing -d /stdata && \
|
ARG ST_UID="1000"
|
||||||
|
|
||||||
|
RUN groupadd -g ${ST_GID} syncthing && \
|
||||||
|
useradd -g ${ST_GID} -u ${ST_UID} syncthing -d /stdata && \
|
||||||
pacman -Fyy --noconfirm && \
|
pacman -Fyy --noconfirm && \
|
||||||
pacman -Syu --noconfirm && \
|
pacman -Syu --noconfirm && \
|
||||||
pacman -S --noconfirm syncthing syncthing-relaysrv
|
pacman -S --noconfirm syncthing syncthing-relaysrv
|
||||||
|
|
||||||
VOLUME /syncthing
|
RUN mkdir /stdata && \
|
||||||
|
mkdir /stconfig && \
|
||||||
|
mkdir /stconfig/config && \
|
||||||
|
chown -R syncthing:syncthing /stdata && \
|
||||||
|
chmod -R 774 /stdata && \
|
||||||
|
chown -R syncthing:syncthing /stconfig && \
|
||||||
|
chmod -R 774 /stconfig
|
||||||
|
VOLUME /stdata
|
||||||
|
VOLUME /stconfig
|
||||||
|
|
||||||
|
|
||||||
# Syncthing
|
# Syncthing
|
||||||
EXPOSE 8384
|
EXPOSE 8384
|
||||||
|
|
||||||
# Relay
|
# Relay
|
||||||
EXPOSE 22067
|
EXPOSE 22067
|
||||||
|
|
||||||
COPY start.sh /start.sh
|
|
||||||
|
USER ${ST_UID}
|
||||||
|
WORKDIR "/stdata"
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/bash", "start.sh"]
|
ENTRYPOINT ["/bin/bash", "start.sh"]
|
||||||
|
|
|
@ -1,22 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Files go here
|
|
||||||
mkdir /stdata
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Configs go here
|
|
||||||
mkdir /stconfig
|
|
||||||
mkdir /stconfig/config
|
|
||||||
|
|
||||||
chown -R syncthing:syncthing /stdata
|
|
||||||
chmod -R 774 /stdata
|
|
||||||
|
|
||||||
chown -R syncthing:syncthing /stconfig
|
|
||||||
chmod -R 774 /stconfig
|
|
||||||
|
|
||||||
su - syncthing -c '
|
|
||||||
cd /stconfig
|
|
||||||
syncthing-relaysrv \
|
syncthing-relaysrv \
|
||||||
-pools="" \
|
-pools="" \
|
||||||
-keys="/stconfig" \
|
-keys="/stconfig" \
|
||||||
|
@ -24,13 +7,11 @@ syncthing-relaysrv \
|
||||||
-ping-interval="30s" \
|
-ping-interval="30s" \
|
||||||
-protocol="tcp4" \
|
-protocol="tcp4" \
|
||||||
-provided-by="Betalupi" \
|
-provided-by="Betalupi" \
|
||||||
-status-srv=""' &
|
-status-srv="" &
|
||||||
|
|
||||||
su - syncthing -c '
|
|
||||||
syncthing \
|
syncthing \
|
||||||
-gui-address=0.0.0.0:8384 \
|
-gui-address=0.0.0.0:8384 \
|
||||||
-home="/stconfig/config" \
|
-home="/stconfig/config" \
|
||||||
--no-browser
|
--no-browser
|
||||||
'
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue