peertube-app/Dockerfile

48 lines
2.2 KiB
Docker
Raw Normal View History

2020-06-16 04:47:04 +00:00
FROM cloudron/base:2.0.0@sha256:f9fea80513aa7c92fe2e7bf3978b54c8ac5222f47a9a32a7f8833edf0eb5a4f4
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
2020-12-02 18:15:31 +00:00
# ffmpeg >= 4.1 is required (https://github.com/Chocobozzz/PeerTube/issues/2469)
RUN apt-get -y update && \
add-apt-repository ppa:jonathonf/ffmpeg-4 && \
apt-get update && \
apt -y install ffmpeg x264 x265 && \
rm -rf /var/cache/apt /var/lib/apt/lists
2020-06-16 04:47:04 +00:00
# install yq
RUN curl -sL https://github.com/mikefarah/yq/releases/download/3.2.1/yq_linux_amd64 -o /usr/bin/yq && \
chmod +x /usr/bin/yq
2020-12-30 22:53:25 +00:00
ARG VERSION=3.0.0-rc.1
2020-06-16 04:47:04 +00:00
# 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 && \
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
# 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
# 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
RUN echo 'alias peertube="cd /app/code/cli && node dist/server/tools/peertube.js"' > ~/.bashrc
2020-06-16 04:47:04 +00:00
CMD [ "/app/pkg/start.sh" ]