Dockerfile.bullseye 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. FROM node:16-bullseye-slim
  2. # Install dependencies
  3. RUN apt update \
  4. && apt install -y --no-install-recommends openssl ffmpeg python3 ca-certificates gnupg gosu build-essential curl git \
  5. && gosu nobody true \
  6. && rm /var/lib/apt/lists/* -fR
  7. # Add peertube user
  8. RUN groupadd -r peertube \
  9. && useradd -r -g peertube -m peertube
  10. # Install PeerTube
  11. COPY --chown=peertube:peertube . /app
  12. WORKDIR /app
  13. USER peertube
  14. # Install manually client dependencies to apply our network timeout option
  15. RUN cd client && yarn install --pure-lockfile --network-timeout 1200000 && cd ../ \
  16. && yarn install --pure-lockfile --network-timeout 1200000 \
  17. && npm run build \
  18. && rm -r ./node_modules ./client/node_modules ./client/.angular \
  19. && yarn install --pure-lockfile --production --network-timeout 1200000 --network-concurrency 20 \
  20. && yarn cache clean
  21. USER root
  22. RUN mkdir /data /config
  23. RUN chown -R peertube:peertube /data /config
  24. ENV NODE_ENV production
  25. ENV NODE_CONFIG_DIR /app/config:/app/support/docker/production/config:/config
  26. ENV PEERTUBE_LOCAL_CONFIG /config
  27. VOLUME /data
  28. VOLUME /config
  29. COPY ./support/docker/production/entrypoint.sh /usr/local/bin/entrypoint.sh
  30. ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
  31. # Expose API and RTMP
  32. EXPOSE 9000 1935
  33. # Run the application
  34. CMD [ "node", "dist/server" ]