ニジカ投稿局 https://tv.nizika.tv
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.
 
 
 
 
 

53 lines
1.5 KiB

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