]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - support/docker/production/Dockerfile.stretch
Updated openapi.html ExternalDocs url
[github/Chocobozzz/PeerTube.git] / support / docker / production / Dockerfile.stretch
CommitLineData
e8395f02 1FROM node:8-stretch
2
9c85ee2e
AM
3# Allow to pass extra options to the npm run build
4# eg: --light --light-fr to not build all client languages
5# (speed up build time if i18n is not required)
6ARG NPM_RUN_BUILD_OPTS
7
399d20ea
FP
8RUN set -ex; \
9 if ! command -v gpg > /dev/null; then \
10 apt-get update; \
11 apt-get install -y --no-install-recommends \
12 gnupg \
13 dirmngr \
14 ; \
15 rm -rf /var/lib/apt/lists/*; \
16fi
17
e8395f02 18# Install dependencies
19RUN apt-get update \
c7574e86
A
20 && apt-get -y install ffmpeg \
21 && rm /var/lib/apt/lists/* -fR
e8395f02 22
c7574e86 23# Add peertube user
399d20ea
FP
24RUN groupadd -r peertube \
25 && useradd -r -g peertube -m peertube
26
27# grab gosu for easy step-down from root
73a48728
C
28RUN set -eux; \
29 apt-get update; \
30 apt-get install -y gosu; \
31 rm -rf /var/lib/apt/lists/*; \
32 gosu nobody true
e8395f02 33
c7574e86 34# Install PeerTube
c7574e86 35WORKDIR /app
c36d5a6b
C
36COPY . ./
37RUN chown -R peertube:peertube /app
4aeb67a5
C
38
39USER peertube
c7574e86
A
40
41RUN yarn install --pure-lockfile \
9c85ee2e 42 && npm run build -- $NPM_RUN_BUILD_OPTS \
d1e59223 43 && rm -r ./node_modules ./client/node_modules \
904a463c 44 && yarn install --pure-lockfile --production \
e5095ca5 45 && yarn cache clean
e8395f02 46
fd5e57bb
C
47USER root
48
49RUN mkdir /data /config
50RUN chown -R peertube:peertube /data /config
51
e8395f02 52ENV NODE_ENV production
fd5e57bb 53ENV NODE_CONFIG_DIR /config
e8395f02 54
399d20ea 55VOLUME /data
fd5e57bb 56VOLUME /config
399d20ea 57
4aeb67a5
C
58COPY ./support/docker/production/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
59ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
399d20ea 60
e8395f02 61# Run the application
62CMD ["npm", "start"]
e8395f02 63EXPOSE 9000