Mirror of PeerTube
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.

Dockerfile.stretch 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. FROM node:8-stretch
  2. RUN set -ex; \
  3. if ! command -v gpg > /dev/null; then \
  4. apt-get update; \
  5. apt-get install -y --no-install-recommends \
  6. gnupg \
  7. dirmngr \
  8. ; \
  9. rm -rf /var/lib/apt/lists/*; \
  10. fi
  11. # Install dependencies
  12. RUN apt-get update \
  13. && apt-get -y install ffmpeg \
  14. && rm /var/lib/apt/lists/* -fR
  15. # Add peertube user
  16. RUN groupadd -r peertube \
  17. && useradd -r -g peertube -m peertube
  18. # grab gosu for easy step-down from root
  19. # https://github.com/tianon/gosu/releases
  20. ENV GOSU_VERSION 1.10
  21. RUN set -ex; \
  22. \
  23. fetchDeps='ca-certificates wget'; \
  24. apt-get update; \
  25. apt-get install -y --no-install-recommends $fetchDeps; \
  26. rm -rf /var/lib/apt/lists/*; \
  27. \
  28. dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
  29. wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \
  30. wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \
  31. export GNUPGHOME="$(mktemp -d)"; \
  32. for server in $(shuf -e ha.pool.sks-keyservers.net \
  33. hkp://p80.pool.sks-keyservers.net:80 \
  34. keyserver.ubuntu.com \
  35. hkp://keyserver.ubuntu.com:80 \
  36. pgp.mit.edu) ; do \
  37. gpg --keyserver "$server" --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 && break || : ; \
  38. done; \
  39. gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
  40. rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc; \
  41. chmod +x /usr/local/bin/gosu; \
  42. gosu nobody true; \
  43. \
  44. apt-get purge -y --auto-remove wget
  45. # Install PeerTube
  46. WORKDIR /app
  47. RUN chown peertube:peertube /app
  48. COPY --chown=peertube:peertube . ./
  49. USER peertube
  50. RUN yarn install --pure-lockfile \
  51. && npm run build
  52. # Configure PeerTube
  53. RUN cp /app/config/default.yaml /app/support/docker/production/config/default.yaml
  54. ENV NODE_ENV production
  55. ENV NODE_CONFIG_DIR /app/support/docker/production/config
  56. USER root
  57. RUN mkdir /data
  58. VOLUME /data
  59. COPY ./support/docker/production/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
  60. ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
  61. # Run the application
  62. CMD ["npm", "start"]
  63. EXPOSE 9000