From 1606ac207dd276dd2ad9971608ff7320d2b8ffeb Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 16 Nov 2021 17:03:44 +0100 Subject: Migrate docker image to bullseye --- .gitlab-ci.yml | 12 +++---- support/doc/docker.md | 2 +- support/docker/production/Dockerfile.bullseye | 49 +++++++++++++++++++++++++++ support/docker/production/Dockerfile.buster | 49 --------------------------- support/docker/production/docker-compose.yml | 4 +-- 5 files changed, 58 insertions(+), 58 deletions(-) create mode 100644 support/docker/production/Dockerfile.bullseye delete mode 100644 support/docker/production/Dockerfile.buster diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9dca22e68..ad94c8cab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -56,8 +56,8 @@ build-docker-develop: only: - schedules variables: - DOCKER_IMAGE_NAME: chocobozzz/peertube:develop-buster - DOCKERFILE: $CI_PROJECT_DIR/support/docker/production/Dockerfile.buster + DOCKER_IMAGE_NAME: chocobozzz/peertube:develop-bullseye + DOCKERFILE: $CI_PROJECT_DIR/support/docker/production/Dockerfile.bullseye build-docker-webserver: <<: *docker @@ -72,13 +72,13 @@ build-docker-tag: only: - tags variables: - DOCKER_IMAGE_NAME: chocobozzz/peertube:$CI_COMMIT_TAG-buster - DOCKERFILE: $CI_PROJECT_DIR/support/docker/production/Dockerfile.buster + DOCKER_IMAGE_NAME: chocobozzz/peertube:$CI_COMMIT_TAG-bullseye + DOCKERFILE: $CI_PROJECT_DIR/support/docker/production/Dockerfile.bullseye build-docker-master: <<: *docker only: - master variables: - DOCKER_IMAGE_NAME: chocobozzz/peertube:production-buster - DOCKERFILE: $CI_PROJECT_DIR/support/docker/production/Dockerfile.buster + DOCKER_IMAGE_NAME: chocobozzz/peertube:production-bullseye + DOCKERFILE: $CI_PROJECT_DIR/support/docker/production/Dockerfile.bullseye diff --git a/support/doc/docker.md b/support/doc/docker.md index d83ee3997..dd84937f3 100644 --- a/support/doc/docker.md +++ b/support/doc/docker.md @@ -147,7 +147,7 @@ $ docker-compose up -d ```shell $ git clone https://github.com/chocobozzz/PeerTube /tmp/peertube $ cd /tmp/peertube -$ docker build . -f ./support/docker/production/Dockerfile.buster +$ docker build . -f ./support/docker/production/Dockerfile.bullseye ``` ### Development diff --git a/support/docker/production/Dockerfile.bullseye b/support/docker/production/Dockerfile.bullseye new file mode 100644 index 000000000..7b2650538 --- /dev/null +++ b/support/docker/production/Dockerfile.bullseye @@ -0,0 +1,49 @@ +FROM node:12-bullseye-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 build-essential curl \ + && 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 /app/config:/app/support/docker/production/config:/config +ENV PEERTUBE_LOCAL_CONFIG /config + +VOLUME /data +VOLUME /config + +COPY ./support/docker/production/entrypoint.sh /usr/local/bin/entrypoint.sh +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] + +# Expose API and RTMP +EXPOSE 9000 1935 + +# Run the application +CMD ["npm", "start"] diff --git a/support/docker/production/Dockerfile.buster b/support/docker/production/Dockerfile.buster deleted file mode 100644 index 163c514f5..000000000 --- a/support/docker/production/Dockerfile.buster +++ /dev/null @@ -1,49 +0,0 @@ -FROM node:12-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 build-essential curl \ - && 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 /app/config:/app/support/docker/production/config:/config -ENV PEERTUBE_LOCAL_CONFIG /config - -VOLUME /data -VOLUME /config - -COPY ./support/docker/production/entrypoint.sh /usr/local/bin/entrypoint.sh -ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] - -# Expose API and RTMP -EXPOSE 9000 1935 - -# Run the application -CMD ["npm", "start"] diff --git a/support/docker/production/docker-compose.yml b/support/docker/production/docker-compose.yml index 658833700..cf90b226f 100644 --- a/support/docker/production/docker-compose.yml +++ b/support/docker/production/docker-compose.yml @@ -44,8 +44,8 @@ services: # If you don't want to use the official image and build one from sources: # build: # context: . - # dockerfile: ./support/docker/production/Dockerfile.buster - image: chocobozzz/peertube:production-buster + # dockerfile: ./support/docker/production/Dockerfile.bullseye + image: chocobozzz/peertube:production-bullseye # Use a static IP for this container because nginx does not handle proxy host change without reload # This container could be restarted on crash or until the postgresql database is ready for connection networks: -- cgit v1.2.3