Docker peertube image
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
2.0KB

  1. FROM debian:stretch-slim
  2. ARG PEERTUBE_VER=v2.0.0
  3. ARG NPM_RUN_BUILD_OPTS
  4. ENV UID=991 \
  5. GID=991 \
  6. FORCE_CHOWN=false \
  7. NODE_ENV=production \
  8. NODE_CONFIG_DIR=/config
  9. RUN groupadd -g 991 peertube && useradd -u 991 -g 991 --create-home peertube \
  10. && apt-get update \
  11. && apt-get -y --no-install-recommends install curl gnupg ca-certificates \
  12. && echo "deb http://ftp.debian.org/debian bullseye-backports main contrib non-free" >> /etc/apt/sources.list \
  13. && curl -sL https://deb.nodesource.com/setup_10.x | bash - \
  14. && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
  15. && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
  16. && apt-get update \
  17. && apt-get -y --no-install-recommends install nodejs yarn curl gnupg dirmngr ffmpeg openssl git build-essential \
  18. && apt-get clean \
  19. && echo "****** Clone Peertube ******" \
  20. && git clone --branch ${PEERTUBE_VER} https://github.com/Chocobozzz/PeerTube /app \
  21. && echo "****** chown ******" \
  22. && chown -R peertube:peertube /app \
  23. && cd /app \
  24. && echo "****** run yarn install as user ******" \
  25. && su - peertube -c "cd /app && yarn install --pure-lockfile" \
  26. && echo "****** run npm install as user ******" \
  27. && su - peertube -c "cd /app && npm run build -- $NPM_RUN_BUILD_OPTS && rm -r ./node_modules ./client/node_modules " \
  28. && echo "****** run yarn install as user ******" \
  29. && su - peertube -c "cd /app && yarn install --pure-lockfile --production && yarn cache clean" \
  30. && apt-get remove --purge --yes build-essential curl git \
  31. && apt-get autoremove -y \
  32. && apt-get clean \
  33. && rm -rf /app/.git \
  34. && rm -rf /tmp/* /var/lib/apt/lists/* /var/cache/debconf/*-old \
  35. && rm -rf /usr/share/man/?? \
  36. && rm -rf /usr/share/man/??_* \
  37. && mkdir {/data,/config} \
  38. && chown -R peertube:peertube /data /config
  39. WORKDIR /app/
  40. VOLUME ["/data", "/config"]
  41. EXPOSE 9000
  42. COPY ./support/docker/production/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
  43. ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
  44. CMD ["npm", "start"]