2021-12-15 15:52:49 +00:00
|
|
|
FROM cloudron/base:3.1.0@sha256:eb2ab9c7d361acda2f3ef2d8388154bc48f1651b5013fe6de4beea003018e427
|
2020-06-16 04:47:04 +00:00
|
|
|
|
2020-07-25 04:47:21 +00:00
|
|
|
RUN mkdir -p /app/code/server /app/pkg
|
|
|
|
WORKDIR /app/code/server
|
2020-06-16 04:47:04 +00:00
|
|
|
|
2021-12-14 10:26:06 +00:00
|
|
|
# we require ffmpeg 4.4.1 - https://github.com/Chocobozzz/PeerTube/releases/tag/v4.0.0
|
|
|
|
# https://lindevs.com/install-ffmpeg-on-ubuntu/
|
|
|
|
RUN add-apt-repository -y ppa:savoury1/ffmpeg4 && \
|
|
|
|
apt install -y ffmpeg
|
|
|
|
|
2021-12-14 10:00:22 +00:00
|
|
|
ARG VERSION=4.0.0
|
|
|
|
|
2020-10-15 01:39:04 +00:00
|
|
|
# install peertube. the chown is required for some reason for ffmpeg. it fails with EROFS without it when transcoding
|
2020-10-16 00:28:27 +00:00
|
|
|
# the transcoding patch is at https://github.com/Chocobozzz/PeerTube/pull/3198
|
2020-10-15 01:39:04 +00:00
|
|
|
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 && \
|
2020-10-16 00:28:27 +00:00
|
|
|
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 && \
|
2020-10-15 01:39:04 +00:00
|
|
|
chown -R cloudron:cloudron /app/code/server
|
2020-06-24 19:26:29 +00:00
|
|
|
|
2020-10-14 04:58:07 +00:00
|
|
|
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 && \
|
|
|
|
NOCLIENT=1 yarn install --pure-lockfile && \
|
|
|
|
npm run setup:cli
|
2020-06-16 04:47:04 +00:00
|
|
|
|
2020-07-22 21:03:41 +00:00
|
|
|
# the json is created and managed by web ui. it overrides the yaml file (https://github.com/lorenwest/node-config/wiki/Configuration-Files)
|
2020-07-25 04:47:21 +00:00
|
|
|
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
|
2020-06-16 04:47:04 +00:00
|
|
|
|
2020-10-14 05:17:15 +00:00
|
|
|
# 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
|
|
|
|
|
2020-06-16 04:47:04 +00:00
|
|
|
COPY production.yaml.example start.sh /app/pkg/
|
|
|
|
|
|
|
|
ENV NODE_ENV production
|
2020-07-25 04:47:21 +00:00
|
|
|
ENV NODE_CONFIG_DIR /app/code/server/config
|
2020-06-16 04:47:04 +00:00
|
|
|
|
2021-08-12 21:50:43 +00:00
|
|
|
RUN printf '#!/bin/bash\n\ncd /app/code/cli && node dist/server/tools/peertube.js $@\n' > /usr/bin/peertube && chmod +x /usr/bin/peertube
|
2020-10-14 05:17:15 +00:00
|
|
|
|
2020-06-16 04:47:04 +00:00
|
|
|
CMD [ "/app/pkg/start.sh" ]
|
|
|
|
|