This repository has been archived on 2021-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
docker-peertube/Dockerfile

73 lines
2.3 KiB
Docker

FROM debian:bullseye-slim
ARG PEERTUBE_VER=v2.0.0
ENV UID=991 GID=991 \
HTTPS=false \
HOSTNAME=peertube.localhost \
PORT=80 \
DATABASE_HOST=localhost \
DATABASE_PORT=5432 \
DATABASE_USERNAME=peertube \
DATABASE_PASSWORD=peertube \
ADMIN_EMAIL=admin@domain.local \
SIGNUP_ENABLE=false \
TRANSCODING_ENABLE=false \
TRANSCODING_THREADS=2 \
BODY_SIZE=100M \
CACHE_SIZE=100 \
SIGNUP_LIMIT=10 \
VIDEO_QUOTA=-1 \
RESOLUTION_280=true \
RESOLUTION_360=true \
RESOLUTION_480=true \
RESOLUTION_720=true \
RESOLUTION_1080=true \
DEBIAN_FRONTEND=noninteractive
RUN groupadd -g 991 peertube && useradd -u 991 -g 991 --create-home peertube \
&& echo "deb http://ftp.debian.org/debian bullseye-backports main contrib non-free" >> /etc/apt/sources.list \
&& curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get -y --no-install-recommends install nodejs yarn curl gosu gnupg dirmngr ffmpeg openssl git build-essential nginx-light \
&& apt-get clean \
&& echo "****** Clone Peertube ******" \
&& git clone --branch ${PEERTUBE_VER} https://github.com/Chocobozzz/PeerTube /PeerTube \
&& echo "****** chown ******" \
&& chown -R peertube:peertube PeerTube \
&& cd /PeerTube \
&& echo "****** run npm install as user ******" \
&& su - peertube -c "cd /PeerTube && npm install" \
&& echo "****** run yarn install as user ******" \
&& su - peertube -c "cd /PeerTube && yarn install" \
&& echo "****** run npm run build as user ******" \
&& su - peertube -c "cd /PeerTube && npm run build" \
&& apt-get remove --purge --yes build-essential curl git \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /PeerTube/.git \
&& rm -rf /tmp/* /var/lib/apt/lists/* /var/cache/debconf/*-old \
&& rm -rf /usr/share/man/?? \
&& rm -rf /usr/share/man/??_* \
&& mkdir -p /{data,config} \
&& chown -R peertube:peertube /data /config
WORKDIR /PeerTube/
ENV NODE_ENV production
ENV NODE_CONFIG_DIR /config
VOLUME ["/data", "/config"]
VOLUME /config
EXPOSE 9000
COPY rootfs /
RUN chmod +x /usr/local/bin/startup
ENTRYPOINT ["/usr/local/bin/startup"]
CMD ["npm", "start"]