]>
Commit | Line | Data |
---|---|---|
b0f3c7df | 1 | FROM node:16-bullseye-slim |
e8395f02 | 2 | |
3 | # Install dependencies | |
7593d9f8 | 4 | RUN apt update \ |
2c7d736b | 5 | && apt install -y --no-install-recommends openssl ffmpeg python3 ca-certificates gnupg gosu build-essential curl git \ |
244e955e FA |
6 | && gosu nobody true \ |
7 | && rm /var/lib/apt/lists/* -fR | |
e8395f02 | 8 | |
c7574e86 | 9 | # Add peertube user |
399d20ea FP |
10 | RUN groupadd -r peertube \ |
11 | && useradd -r -g peertube -m peertube | |
12 | ||
c7574e86 | 13 | # Install PeerTube |
72698686 | 14 | COPY --chown=peertube:peertube . /app |
c7574e86 | 15 | WORKDIR /app |
4aeb67a5 C |
16 | |
17 | USER peertube | |
c7574e86 | 18 | |
219e18c9 C |
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 \ | |
75b7117f | 22 | && npm run build \ |
8faa7d87 | 23 | && rm -r ./node_modules ./client/node_modules ./client/.angular \ |
b18a501a | 24 | && yarn install --pure-lockfile --production --network-timeout 1200000 --network-concurrency 20 \ |
e5095ca5 | 25 | && yarn cache clean |
e8395f02 | 26 | |
fd5e57bb C |
27 | USER root |
28 | ||
29 | RUN mkdir /data /config | |
30 | RUN chown -R peertube:peertube /data /config | |
31 | ||
e8395f02 | 32 | ENV NODE_ENV production |
8d8a037e JB |
33 | ENV NODE_CONFIG_DIR /app/config:/app/support/docker/production/config:/config |
34 | ENV PEERTUBE_LOCAL_CONFIG /config | |
e8395f02 | 35 | |
399d20ea | 36 | VOLUME /data |
fd5e57bb | 37 | VOLUME /config |
399d20ea | 38 | |
1a9b141d | 39 | COPY ./support/docker/production/entrypoint.sh /usr/local/bin/entrypoint.sh |
6348fb18 | 40 | ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ] |
399d20ea | 41 | |
08d70fe6 RK |
42 | # Expose API and RTMP |
43 | EXPOSE 9000 1935 | |
44 | ||
e8395f02 | 45 | # Run the application |
6348fb18 | 46 | CMD [ "node", "dist/server" ] |