]>
Commit | Line | Data |
---|---|---|
1606ac20 | 1 | FROM node:12-bullseye-slim |
e8395f02 | 2 | |
29706739 | 3 | # Allow to pass extra options to the npm run build |
9c85ee2e AM |
4 | # eg: --light --light-fr to not build all client languages |
5 | # (speed up build time if i18n is not required) | |
6 | ARG NPM_RUN_BUILD_OPTS | |
7 | ||
e8395f02 | 8 | # Install dependencies |
7593d9f8 | 9 | RUN apt update \ |
aa7d2da4 | 10 | && apt install -y --no-install-recommends openssl ffmpeg python ca-certificates gnupg gosu build-essential curl \ |
244e955e FA |
11 | && gosu nobody true \ |
12 | && rm /var/lib/apt/lists/* -fR | |
e8395f02 | 13 | |
c7574e86 | 14 | # Add peertube user |
399d20ea FP |
15 | RUN groupadd -r peertube \ |
16 | && useradd -r -g peertube -m peertube | |
17 | ||
c7574e86 | 18 | # Install PeerTube |
72698686 | 19 | COPY --chown=peertube:peertube . /app |
c7574e86 | 20 | WORKDIR /app |
4aeb67a5 C |
21 | |
22 | USER peertube | |
c7574e86 | 23 | |
14a07e01 | 24 | RUN yarn install --pure-lockfile --network-timeout 600000 \ |
9c85ee2e | 25 | && npm run build -- $NPM_RUN_BUILD_OPTS \ |
d1e59223 | 26 | && rm -r ./node_modules ./client/node_modules \ |
14a07e01 | 27 | && yarn install --pure-lockfile --production --network-timeout 600000 \ |
e5095ca5 | 28 | && yarn cache clean |
e8395f02 | 29 | |
fd5e57bb C |
30 | USER root |
31 | ||
32 | RUN mkdir /data /config | |
33 | RUN chown -R peertube:peertube /data /config | |
34 | ||
e8395f02 | 35 | ENV NODE_ENV production |
8d8a037e JB |
36 | ENV NODE_CONFIG_DIR /app/config:/app/support/docker/production/config:/config |
37 | ENV PEERTUBE_LOCAL_CONFIG /config | |
e8395f02 | 38 | |
399d20ea | 39 | VOLUME /data |
fd5e57bb | 40 | VOLUME /config |
399d20ea | 41 | |
1a9b141d RK |
42 | COPY ./support/docker/production/entrypoint.sh /usr/local/bin/entrypoint.sh |
43 | ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] | |
399d20ea | 44 | |
08d70fe6 RK |
45 | # Expose API and RTMP |
46 | EXPOSE 9000 1935 | |
47 | ||
e8395f02 | 48 | # Run the application |
29706739 | 49 | CMD ["npm", "start"] |