Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
Signed-off-by: Zoey <[email protected]>
  • Loading branch information
Zoey2936 authored May 2, 2024
1 parent ad15b1d commit 291f809
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,35 @@ ARG PT_VERSION=v6.1.0 \
TARGETARCH

RUN apk upgrade --no-cache -a && \
apk add --no-cache ca-certificates bash nodejs-current yarn npm git && \
apk add --no-cache ca-certificates bash nodejs yarn npm git && \
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 && \
clean-modules --yes && \
cd /app && \
npm_config_target_platform=linux npm_config_target_arch=x64 yarn install --no-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 --no-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 && \
clean-modules --yes && \
cd /app && \
npm_config_target_platform=linux npm_config_target_arch=arm64 yarn install --no-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 --no-lockfile --production && \
clean-modules --yes; \
fi && \
cd /app && clean-modules --yes && \
cd /app/client && clean-modules --yes && \
yarn cache clean --all

FROM alpine:3.19.1
Expand All @@ -36,7 +42,7 @@ COPY --from=build /app /app
WORKDIR /app

# Install dependencies
RUN apk add --no-cache ca-certificates tzdata tini ffmpeg su-exec shadow nodejs-current && \
RUN apk add --no-cache ca-certificates tzdata tini ffmpeg su-exec shadow nodejs && \
# Add peertube user
groupadd -r peertube && \
useradd -r -g peertube -m peertube && \
Expand Down

0 comments on commit 291f809

Please sign in to comment.