1
0
Fork 0
peertube/support/docker/production/Dockerfile.buster
Rigel Kent 1a9b141d83
Add nginx behind traefik in docker-compose + image updates
- support/docker/production/docker-compose.yml: addition of a nginx
image reusing support/nginx/peertube nginx conf to improve performance,
and lessen setup differences between the docker-compose install and the
typical production install.
- support/docker/production/docker-compose.yml: postgres 10 -> postgres
12, redis 4 -> redis 5. Postgres major updates implies manual upgrade.
- support/nginx/peertube: HTTP -> HTTPS redirection is now commented
by default, to allow its reuse in support/docker/production/docker-compose.yml.
2020-11-11 16:45:46 +01:00

46 lines
1.1 KiB
Text

FROM node:10-buster-slim
# Allow to pass extra options to the npm run build
# eg: --light --light-fr to not build all client languages
# (speed up build time if i18n is not required)
ARG NPM_RUN_BUILD_OPTS
# Install dependencies
RUN apt update \
&& apt install -y --no-install-recommends openssl ffmpeg python ca-certificates gnupg gosu \
&& gosu nobody true \
&& rm /var/lib/apt/lists/* -fR
# Add peertube user
RUN groupadd -r peertube \
&& useradd -r -g peertube -m peertube
# Install PeerTube
COPY --chown=peertube:peertube . /app
WORKDIR /app
USER peertube
RUN yarn install --pure-lockfile \
&& npm run build -- $NPM_RUN_BUILD_OPTS \
&& rm -r ./node_modules ./client/node_modules \
&& yarn install --pure-lockfile --production \
&& yarn cache clean
USER root
RUN mkdir /data /config
RUN chown -R peertube:peertube /data /config
ENV NODE_ENV production
ENV NODE_CONFIG_DIR /config
VOLUME /data
VOLUME /config
COPY ./support/docker/production/entrypoint.sh /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
# Run the application
CMD ["npm", "start"]
EXPOSE 9000