From c82bf36a3f61fe051a2ead506a6f7b90d083bb32 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 12 Dec 2019 09:49:31 +0100 Subject: Docker: stretch -> buster --- support/docker/production/Dockerfile.buster | 46 ++++++++++++++++++++++++++++ support/docker/production/Dockerfile.stretch | 46 ---------------------------- support/docker/production/docker-compose.yml | 4 +-- 3 files changed, 48 insertions(+), 48 deletions(-) create mode 100644 support/docker/production/Dockerfile.buster delete mode 100644 support/docker/production/Dockerfile.stretch (limited to 'support/docker') diff --git a/support/docker/production/Dockerfile.buster b/support/docker/production/Dockerfile.buster new file mode 100644 index 000000000..32c5266c5 --- /dev/null +++ b/support/docker/production/Dockerfile.buster @@ -0,0 +1,46 @@ +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 ffmpeg 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/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + +# Run the application +CMD ["npm", "start"] +EXPOSE 9000 diff --git a/support/docker/production/Dockerfile.stretch b/support/docker/production/Dockerfile.stretch deleted file mode 100644 index 32c5266c5..000000000 --- a/support/docker/production/Dockerfile.stretch +++ /dev/null @@ -1,46 +0,0 @@ -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 ffmpeg 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/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh -ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] - -# Run the application -CMD ["npm", "start"] -EXPOSE 9000 diff --git a/support/docker/production/docker-compose.yml b/support/docker/production/docker-compose.yml index 9f6c47eca..b81a8745b 100644 --- a/support/docker/production/docker-compose.yml +++ b/support/docker/production/docker-compose.yml @@ -23,8 +23,8 @@ services: # If you don't want to use the official image and build one from sources # build: # context: . - # dockerfile: ./support/docker/production/Dockerfile.stretch - image: chocobozzz/peertube:production-stretch + # dockerfile: ./support/docker/production/Dockerfile.buster + image: chocobozzz/peertube:production-buster env_file: - .env # Traefik labels are suggested as an example for people using Traefik, -- cgit v1.2.3