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