peertube-app/Dockerfile
2022-05-05 22:35:01 -06:00

45 lines
2.4 KiB
Docker

FROM cloudron/base:3.2.0@sha256:ba1d566164a67c266782545ea9809dc611c4152e27686fd14060332dd88263ea
RUN mkdir -p /app/code/server /app/pkg
WORKDIR /app/code/server
# we require ffmpeg 4.4.1 - https://github.com/Chocobozzz/PeerTube/releases/tag/v4.0.0
# https://lindevs.com/install-ffmpeg-on-ubuntu/
RUN echo deb http://packages.prosody.im/debian $(lsb_release -sc) main | sudo tee /etc/apt/sources.list.d/prosody.list
RUN sudo wget https://prosody.im/files/prosody-debian-packages.key -O/etc/apt/trusted.gpg.d/prosody.gpg
RUN sudo apt update
RUN add-apt-repository -y ppa:savoury1/ffmpeg4 && \
apt install -y ffmpeg prosody
ARG VERSION=4.1.1
# install peertube. the chown is required for some reason for ffmpeg. it fails with EROFS without it when transcoding
# the transcoding patch is at https://github.com/Chocobozzz/PeerTube/pull/3198
RUN curl -sL https://github.com/Chocobozzz/PeerTube/releases/download/v${VERSION}/peertube-v${VERSION}.tar.xz | tar --strip-components 1 -Jxvf - && \
yarn install --production --pure-lockfile && \
sed -e 's/niceness: constants_1.FFMPEG_NICE.TRANSCODING/niceness: constants_1.FFMPEG_NICE.TRANSCODING, cwd: config_1.CONFIG.STORAGE.TMP_DIR/' -i /app/code/server/dist/server/helpers/ffmpeg-utils.js
# CLI patch for https://github.com/Chocobozzz/PeerTube/issues/4858
RUN mkdir /app/code/cli && \
curl -L https://github.com/Chocobozzz/PeerTube/archive/v${VERSION}.tar.gz | tar -zxvf - --strip-components=1 -C /app/code/cli && \
cd /app/code/cli && \
curl -L https://github.com/Chocobozzz/PeerTube/commit/74220dba9db6a1dc5c0b504b0230de26ef9c9dd5.patch -o /tmp/cli.patch && patch -p1 < /tmp/cli.patch && rm /tmp/cli.patch && \
NOCLIENT=1 yarn install --pure-lockfile && \
npm run setup:cli
# the json is created and managed by web ui. it overrides the yaml file (https://github.com/lorenwest/node-config/wiki/Configuration-Files)
RUN ln -sf /app/data/production.yaml /app/code/server/config/production.yaml && \
ln -sf /app/data/local-production.json /app/code/server/config/local-production.json
# youtube-dl
RUN curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl && chmod +x /usr/local/bin/youtube-dl
COPY production.yaml.example start.sh /app/pkg/
ENV NODE_ENV production
ENV NODE_CONFIG_DIR /app/code/server/config
RUN printf '#!/bin/bash\n\ncd /app/code/cli && node dist/server/tools/peertube.js $@\n' > /usr/bin/peertube && chmod +x /usr/bin/peertube
CMD [ "/app/pkg/start.sh" ]