]>
Commit | Line | Data |
---|---|---|
e8395f02 | 1 | FROM node:8-stretch |
2 | ||
399d20ea FP |
3 | RUN set -ex; \ |
4 | if ! command -v gpg > /dev/null; then \ | |
5 | apt-get update; \ | |
6 | apt-get install -y --no-install-recommends \ | |
7 | gnupg \ | |
8 | dirmngr \ | |
9 | ; \ | |
10 | rm -rf /var/lib/apt/lists/*; \ | |
11 | fi | |
12 | ||
e8395f02 | 13 | # Install dependencies |
14 | RUN apt-get update \ | |
c7574e86 A |
15 | && apt-get -y install ffmpeg \ |
16 | && rm /var/lib/apt/lists/* -fR | |
e8395f02 | 17 | |
c7574e86 | 18 | # Add peertube user |
399d20ea FP |
19 | RUN groupadd -r peertube \ |
20 | && useradd -r -g peertube -m peertube | |
21 | ||
22 | # grab gosu for easy step-down from root | |
73a48728 C |
23 | RUN set -eux; \ |
24 | apt-get update; \ | |
25 | apt-get install -y gosu; \ | |
26 | rm -rf /var/lib/apt/lists/*; \ | |
27 | gosu nobody true | |
e8395f02 | 28 | |
c7574e86 | 29 | # Install PeerTube |
c7574e86 | 30 | WORKDIR /app |
c36d5a6b C |
31 | COPY . ./ |
32 | RUN chown -R peertube:peertube /app | |
4aeb67a5 C |
33 | |
34 | USER peertube | |
c7574e86 A |
35 | |
36 | RUN yarn install --pure-lockfile \ | |
d1e59223 C |
37 | && npm run build \ |
38 | && rm -r ./node_modules ./client/node_modules \ | |
904a463c | 39 | && yarn install --pure-lockfile --production \ |
e5095ca5 | 40 | && yarn cache clean |
e8395f02 | 41 | |
fd5e57bb C |
42 | USER root |
43 | ||
44 | RUN mkdir /data /config | |
45 | RUN chown -R peertube:peertube /data /config | |
46 | ||
e8395f02 | 47 | ENV NODE_ENV production |
fd5e57bb | 48 | ENV NODE_CONFIG_DIR /config |
e8395f02 | 49 | |
399d20ea | 50 | VOLUME /data |
fd5e57bb | 51 | VOLUME /config |
399d20ea | 52 | |
4aeb67a5 C |
53 | COPY ./support/docker/production/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh |
54 | ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] | |
399d20ea | 55 | |
e8395f02 | 56 | # Run the application |
57 | CMD ["npm", "start"] | |
e8395f02 | 58 | EXPOSE 9000 |