Try to fix automatic dockerbuild
authorChocobozzz <me@florianbigard.com>
Mon, 16 Apr 2018 17:03:56 +0000 (19:03 +0200)
committerChocobozzz <me@florianbigard.com>
Mon, 16 Apr 2018 17:04:04 +0000 (19:04 +0200)
support/docker/production/Dockerfile.stretch
support/docker/production/docker-entrypoint.sh

index 5bb67f81619700b4ef5ae32178b51170a1d0fc3e..999ab9da4e59a65c4d69386d6298e6d8bcaa63f9 100644 (file)
@@ -41,7 +41,7 @@ RUN set -ex; \
         gpg --keyserver "$server" --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 && break || : ; \
     done; \
     gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
-    rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc; \
+    rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \
     chmod +x /usr/local/bin/gosu; \
     gosu nobody true; \
     \
@@ -64,7 +64,7 @@ ENV NODE_ENV production
 ENV NODE_CONFIG_DIR /app/support/docker/production/config
 
 USER root
-RUN mkdir /data
+RUN mkdir /data && chown peertube:peertube /data
 VOLUME /data
 
 COPY ./support/docker/production/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
index 4099a19847f7e15168aa920a7c34b38bdfd61773..ba9fcfed5b541964b1fcd335bd578e2fb5a54d26 100755 (executable)
@@ -8,7 +8,7 @@ if [ "${1#-}" != "$1" ] || [ "${1%.conf}" != "$1" ]; then
 fi
 
 # allow the container to be started with `--user`
-if [ "$1" = 'npm' -a "$(id -u)" != '0' ]; then
+if [ "$1" = 'npm' -a "$(id -u)" = '0' ]; then
     chown -R peertube:peertube /data
     exec gosu peertube "$0" "$@"
 fi