]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - support/docker/production/Dockerfile.stretch
Fix tests
[github/Chocobozzz/PeerTube.git] / support / docker / production / Dockerfile.stretch
... / ...
CommitLineData
1FROM node:10-stretch
2
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
8RUN set -ex; \
9 if ! command -v gpg > /dev/null; then \
10 apt update; \
11 apt install -y --no-install-recommends \
12 gnupg \
13 dirmngr \
14 ; \
15 rm -rf /var/lib/apt/lists/*; \
16fi
17
18# Install dependencies
19RUN apt update \
20 && apt -y install ffmpeg \
21 && rm /var/lib/apt/lists/* -fR
22
23# Add peertube user
24RUN groupadd -r peertube \
25 && useradd -r -g peertube -m peertube
26
27# grab gosu for easy step-down from root
28RUN set -eux; \
29 apt update; \
30 apt install -y gosu; \
31 rm -rf /var/lib/apt/lists/*; \
32 gosu nobody true
33
34# Install PeerTube
35WORKDIR /app
36COPY . ./
37RUN chown -R peertube:peertube /app
38
39USER peertube
40
41RUN yarn install --pure-lockfile \
42 && npm run build -- $NPM_RUN_BUILD_OPTS \
43 && rm -r ./node_modules ./client/node_modules \
44 && yarn install --pure-lockfile --production \
45 && yarn cache clean
46
47USER root
48
49RUN mkdir /data /config
50RUN chown -R peertube:peertube /data /config
51
52ENV NODE_ENV production
53ENV NODE_CONFIG_DIR /config
54
55VOLUME /data
56VOLUME /config
57
58COPY ./support/docker/production/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
59ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
60
61# Run the application
62CMD ["npm", "start"]
63EXPOSE 9000