2023-10-22 17:51:48 +00:00
|
|
|
FROM cloudron/base:4.2.0@sha256:46da2fffb36353ef714f97ae8e962bd2c212ca091108d768ba473078319a47f4
|
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
|
|
|
|
2023-01-03 17:45:50 +00:00
|
|
|
RUN apt update && apt install -y prosody && rm -rf /var/cache/apt /var/lib/apt/lists
|
2021-12-14 10:26:06 +00:00
|
|
|
|
2023-12-22 16:33:29 +00:00
|
|
|
ARG VERSION=6.0.2
|
2021-12-14 10:00:22 +00:00
|
|
|
|
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
|
|
|
|
RUN curl -sL https://github.com/Chocobozzz/PeerTube/releases/download/v${VERSION}/peertube-v${VERSION}.tar.xz | tar --strip-components 1 -Jxvf - && \
|
2022-06-07 19:47:24 +00:00
|
|
|
yarn install --production --pure-lockfile
|
2020-06-24 19:26:29 +00:00
|
|
|
|
2023-12-22 16:33:29 +00:00
|
|
|
RUN npm install -g @peertube/peertube-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
|
|
|
|
|
2022-05-12 18:22:44 +00:00
|
|
|
# required when installing plugins/themes that use node-gyp
|
2023-06-21 15:07:26 +00:00
|
|
|
RUN rm -rf /home/cloudron/.cache && ln -s /run/peertube/cache /home/cloudron/.cache && \
|
|
|
|
rm -rf /home/cloudron/.npm && ln -s /run/peertube/npm /home/cloudron/.npm
|
2022-05-12 18:22:44 +00:00
|
|
|
|
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
|
|
|
|
2024-01-10 17:04:08 +00:00
|
|
|
|
|
|
|
# add nginx config
|
|
|
|
RUN rm /etc/nginx/sites-enabled/*
|
|
|
|
RUN ln -sf /dev/stdout /var/log/nginx/access.log
|
|
|
|
RUN ln -sf /dev/stderr /var/log/nginx/error.log
|
|
|
|
RUN ln -sf /run/peertube-nginx.conf /etc/nginx/sites-enabled/peertube.conf
|
|
|
|
COPY nginx/readonlyrootfs.conf /etc/nginx/conf.d/readonlyrootfs.conf
|
|
|
|
COPY nginx/peertube.conf /app/pkg/peertube-nginx.conf
|
|
|
|
|
|
|
|
# supervisor
|
|
|
|
COPY supervisor/ /etc/supervisor/conf.d/
|
|
|
|
RUN sed -e 's,^logfile=.*$,logfile=/run/supervisord.log,' -i /etc/supervisor/supervisord.conf
|
|
|
|
|
2020-06-16 04:47:04 +00:00
|
|
|
CMD [ "/app/pkg/start.sh" ]
|
|
|
|
|