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