]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - support/docker/production/Dockerfile.stretch
Fix comments feed
[github/Chocobozzz/PeerTube.git] / support / docker / production / Dockerfile.stretch
... / ...
CommitLineData
1FROM node:10-stretch-slim
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
8# Install dependencies
9RUN apt update \
10 && apt install -y --no-install-recommends ffmpeg gnupg gosu \
11 && gosu nobody true \
12 && rm /var/lib/apt/lists/* -fR
13
14# Add peertube user
15RUN groupadd -r peertube \
16 && useradd -r -g peertube -m peertube
17
18# Install PeerTube
19WORKDIR /app
20COPY . ./
21RUN chown -R peertube:peertube /app
22
23USER peertube
24
25RUN yarn install --pure-lockfile \
26 && npm run build -- $NPM_RUN_BUILD_OPTS \
27 && rm -r ./node_modules ./client/node_modules \
28 && yarn install --pure-lockfile --production \
29 && yarn cache clean
30
31USER root
32
33RUN mkdir /data /config
34RUN chown -R peertube:peertube /data /config
35
36ENV NODE_ENV production
37ENV NODE_CONFIG_DIR /config
38
39VOLUME /data
40VOLUME /config
41
42COPY ./support/docker/production/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
43ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
44
45# Run the application
46CMD ["npm", "start"]
47EXPOSE 9000