]>
Commit | Line | Data |
---|---|---|
1 | FROM node:14-bullseye-slim | |
2 | ||
3 | # Install dependencies | |
4 | RUN apt update \ | |
5 | && apt install -y --no-install-recommends openssl ffmpeg python3 ca-certificates gnupg gosu build-essential curl \ | |
6 | && gosu nobody true \ | |
7 | && rm /var/lib/apt/lists/* -fR | |
8 | ||
9 | # Add peertube user | |
10 | RUN groupadd -r peertube \ | |
11 | && useradd -r -g peertube -m peertube | |
12 | ||
13 | # Install PeerTube | |
14 | COPY --chown=peertube:peertube . /app | |
15 | WORKDIR /app | |
16 | ||
17 | USER peertube | |
18 | ||
19 | # Install manually client dependencies to apply our network timeout option | |
20 | RUN cd client && yarn install --pure-lockfile --network-timeout 1200000 && cd ../ \ | |
21 | && yarn install --pure-lockfile --network-timeout 1200000 \ | |
22 | && npm run build \ | |
23 | && rm -r ./node_modules ./client/node_modules ./client/.angular \ | |
24 | && yarn install --pure-lockfile --production --network-timeout 1200000 --network-concurrency 20 \ | |
25 | && yarn cache clean | |
26 | ||
27 | USER root | |
28 | ||
29 | RUN mkdir /data /config | |
30 | RUN chown -R peertube:peertube /data /config | |
31 | ||
32 | ENV NODE_ENV production | |
33 | ENV NODE_CONFIG_DIR /app/config:/app/support/docker/production/config:/config | |
34 | ENV PEERTUBE_LOCAL_CONFIG /config | |
35 | ||
36 | VOLUME /data | |
37 | VOLUME /config | |
38 | ||
39 | COPY ./support/docker/production/entrypoint.sh /usr/local/bin/entrypoint.sh | |
40 | ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] | |
41 | ||
42 | # Expose API and RTMP | |
43 | EXPOSE 9000 1935 | |
44 | ||
45 | # Run the application | |
46 | CMD ["npm", "start"] |