3 # Allow to pass extra options to the yarn run build
4 # eg: --light --light-fr to not build all client languages
5 # (speed up build time if i18n is not required)
9 if ! command -v gpg > /dev/null; then \
11 apt install -y --no-install-recommends \
15 rm -rf /var/lib/apt/lists/*; \
18 # Install dependencies
20 && apt -y install ffmpeg \
21 && rm /var/lib/apt/lists/* -fR
24 RUN groupadd -r peertube \
25 && useradd -r -g peertube -m peertube
27 # grab gosu for easy step-down from root
30 apt install -y gosu; \
31 rm -rf /var/lib/apt/lists/*; \
37 RUN chown -R peertube:peertube /app
41 RUN yarn install --pure-lockfile \
42 && npm run build -- $NPM_RUN_BUILD_OPTS \
43 && rm -r ./node_modules ./client/node_modules \
44 && yarn install --pure-lockfile --production \
49 RUN mkdir /data /config
50 RUN chown -R peertube:peertube /data /config
52 ENV NODE_ENV production
53 ENV NODE_CONFIG_DIR /config
58 COPY ./support/docker/production/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
59 ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]