4 if ! command -v gpg > /dev/null; then \
6 apt-get install -y --no-install-recommends \
10 rm -rf /var/lib/apt/lists/*; \
13 # Install dependencies
15 && apt-get -y install ffmpeg \
16 && rm /var/lib/apt/lists/* -fR
19 RUN groupadd -r peertube \
20 && useradd -r -g peertube -m peertube
22 # grab gosu for easy step-down from root
23 # https://github.com/tianon/gosu/releases
27 fetchDeps='ca-certificates wget'; \
29 apt-get install -y --no-install-recommends $fetchDeps; \
30 rm -rf /var/lib/apt/lists/*; \
32 dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
33 wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \
34 wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \
35 export GNUPGHOME="$(mktemp -d)"; \
36 for server in $(shuf -e ha.pool.sks-keyservers.net \
37 hkp://p80.pool.sks-keyservers.net:80 \
38 keyserver.ubuntu.com \
39 hkp://keyserver.ubuntu.com:80 \
41 gpg --keyserver "$server" --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 && break || : ; \
43 gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
44 rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \
45 chmod +x /usr/local/bin/gosu; \
48 apt-get purge -y --auto-remove wget
53 RUN chown -R peertube:peertube /app
57 RUN yarn install --pure-lockfile \
59 && rm -r ./node_modules ./client/node_modules \
60 && yarn install --pure-lockfile --production \
65 RUN mkdir /data /config
66 RUN chown -R peertube:peertube /data /config
68 ENV NODE_ENV production
69 ENV NODE_CONFIG_DIR /config
74 COPY ./support/docker/production/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
75 ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]