Dockerfile tidying up

This commit is contained in:
Vladimir D 2024-10-16 18:52:48 +04:00
parent d7dcfc832d
commit f9869d4b3d

View file

@ -1,11 +1,5 @@
ARG MASTODON_VERSION=4.3.0
ARG MASTODON_VERSION_PRERELEASE=""
ARG MASTODON_VERSION_METADATA=""
FROM cloudron/base:4.2.0@sha256:46da2fffb36353ef714f97ae8e962bd2c212ca091108d768ba473078319a47f4 as build
ARG MASTODON_VERSION
RUN mkdir -p /app/code /app/pkg
WORKDIR /app/code
@ -177,16 +171,17 @@ RUN ./configure \
FROM build
# renovate: datasource=github-releases depName=tootsuite/mastodon versioning=semver extractVersion=^v(?<version>.+)$
ARG MASTODON_VERSION=4.3.0
ARG MASTODON_VERSION_PRERELEASE=""
ARG MASTODON_VERSION_METADATA=""
ENV RAILS_ENV production
ENV NODE_ENV production
ARG RAILS_SERVE_STATIC_FILES="true"
ARG RUBY_YJIT_ENABLE="1"
ENV \
MASTODON_VERSION=${MASTODON_VERSION} \
# Apply Mastodon version information
MASTODON_VERSION_PRERELEASE="${MASTODON_VERSION_PRERELEASE}" \
MASTODON_VERSION_METADATA="${MASTODON_VERSION_METADATA}" \
# Apply Mastodon static files and YJIT options
RAILS_SERVE_STATIC_FILES=${RAILS_SERVE_STATIC_FILES} \
RUBY_YJIT_ENABLE=${RUBY_YJIT_ENABLE} \
@ -211,7 +206,6 @@ RUN ldconfig && \
ffmpeg -version && \
ffprobe -version
# renovate: datasource=github-releases depName=tootsuite/mastodon versioning=semver extractVersion=^v(?<version>.+)$
RUN curl -L https://github.com/tootsuite/mastodon/archive/v${MASTODON_VERSION}.tar.gz | tar -xz --strip-components 1 -f - && \
bundle config --local set deployment 'true' && \
bundle config --local set without 'development test' && \
@ -223,7 +217,7 @@ RUN curl -L https://github.com/tootsuite/mastodon/archive/v${MASTODON_VERSION}.t
RUN corepack enable && \
corepack prepare --activate
RUN yarn workspaces focus --production @mastodon/mastodon;
RUN yarn workspaces focus --production @mastodon/mastodon
RUN yarn install
# Use Ruby on Rails to create Mastodon assets
@ -258,4 +252,3 @@ RUN ln -fs /app/data/system /app/code/public/system
COPY start.sh cleanup.sh config.sh env.template cache-env.sh.template /app/pkg/
CMD [ "/app/pkg/start.sh" ]