diff --git a/Dockerfile b/Dockerfile index e6f2b87..a7868c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,48 +1,48 @@ # syntax=docker/dockerfile:labs -FROM --platform="$BUILDPLATFORM" node:18.20.2-alpine3.19 as build +FROM --platform="$BUILDPLATFORM" alpine:3.19.1 as build SHELL ["/bin/ash", "-eo", "pipefail", "-c"] ARG PT_VERSION=v6.1.0 \ TARGETARCH RUN apk upgrade --no-cache -a && \ - apk add --no-cache ca-certificates bash git && \ + apk add --no-cache ca-certificates bash git nodejs-current yarn npm && \ yarn global add clean-modules && \ git clone --recursive https://github.com/Chocobozzz/PeerTube --branch "$PT_VERSION" /app && \ sed -i "s|gosu|su-exec|g" /app/support/docker/production/entrypoint.sh && \ if [ "$TARGETARCH" = "amd64" ]; then \ cd /app/client && \ - npm_config_target_platform=linux npm_config_target_arch=x64 yarn install --no-lockfile && \ + npm_config_target_platform=linux npm_config_target_arch=x64 yarn install --pure-lockfile && \ clean-modules --yes && \ cd /app && \ - npm_config_target_platform=linux npm_config_target_arch=x64 yarn install --no-lockfile && \ + npm_config_target_platform=linux npm_config_target_arch=x64 yarn install --pure-lockfile && \ clean-modules --yes && \ npm_config_target_platform=linux npm_config_target_arch=x64 npm run build && \ clean-modules --yes && \ rm -r /app/client/.angular /app/client/node_modules /app/node_modules && \ - npm_config_target_platform=linux npm_config_target_arch=x64 yarn install --no-lockfile --production && \ + npm_config_target_platform=linux npm_config_target_arch=x64 yarn install --pure-lockfile --production && \ clean-modules --yes; \ elif [ "$TARGETARCH" = "arm64" ]; then \ cd /app/client && \ - npm_config_target_platform=linux npm_config_target_arch=arm64 yarn install --no-lockfile && \ + npm_config_target_platform=linux npm_config_target_arch=arm64 yarn install --pure-lockfile && \ clean-modules --yes && \ cd /app && \ - npm_config_target_platform=linux npm_config_target_arch=arm64 yarn install --no-lockfile && \ + npm_config_target_platform=linux npm_config_target_arch=arm64 yarn install --pure-lockfile && \ clean-modules --yes && \ npm_config_target_platform=linux npm_config_target_arch=arm64 npm run build && \ clean-modules --yes && \ rm -r /app/client/.angular /app/client/node_modules /app/node_modules && \ - npm_config_target_platform=linux npm_config_target_arch=arm64 yarn install --no-lockfile --production && \ + npm_config_target_platform=linux npm_config_target_arch=arm64 yarn install --pure-lockfile --production && \ clean-modules --yes; \ fi && \ yarn cache clean --all -FROM node:18.20.2-alpine3.19 +FROM alpine:3.19.1 SHELL ["/bin/ash", "-eo", "pipefail", "-c"] COPY --from=build /app /app WORKDIR /app # Install dependencies -RUN apk add --no-cache ca-certificates tzdata tini ffmpeg su-exec shadow && \ +RUN apk add --no-cache ca-certificates tzdata tini ffmpeg su-exec shadow nodejs-current && \ # Add peertube user groupadd -r peertube && \ useradd -r -g peertube -m peertube && \