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