fix: switch from alpine to debian trixie

issue: #234, #199
This commit is contained in:
C4illin 2025-05-22 12:28:03 +02:00 committed by Emrik Östling
parent 6dc60679bb
commit 4e4c029cb8

View file

@ -1,7 +1,17 @@
FROM oven/bun:1.2.2-alpine AS base FROM debian:trixie-slim AS base
LABEL org.opencontainers.image.source="https://github.com/C4illin/ConvertX" LABEL org.opencontainers.image.source="https://github.com/C4illin/ConvertX"
WORKDIR /app WORKDIR /app
# install bun
ENV BUN_INSTALL=/etc/.bun
ENV PATH=$BUN_INSTALL/bin:$PATH
ENV BUN_RUNTIME_TRANSPILER_CACHE_PATH=0
RUN apt-get update && apt-get install -y \
curl \
unzip \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://bun.sh/install | bash -s "bun-v1.2.2"
# install dependencies into temp directory # install dependencies into temp directory
# this will cache them and speed up future builds # this will cache them and speed up future builds
FROM base AS install FROM base AS install
@ -14,12 +24,6 @@ RUN mkdir -p /temp/prod
COPY package.json bun.lock /temp/prod/ COPY package.json bun.lock /temp/prod/
RUN cd /temp/prod && bun install --frozen-lockfile --production RUN cd /temp/prod && bun install --frozen-lockfile --production
FROM base AS builder
RUN apk --no-cache add curl gcc
ENV PATH=/root/.cargo/bin:$PATH
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN cargo install resvg
FROM base AS prerelease FROM base AS prerelease
WORKDIR /app WORKDIR /app
COPY --from=install /temp/dev/node_modules node_modules COPY --from=install /temp/dev/node_modules node_modules
@ -31,38 +35,31 @@ RUN bun run build
# copy production dependencies and source code into final image # copy production dependencies and source code into final image
FROM base AS release FROM base AS release
RUN apk --no-cache add libheif-tools --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community/
# install additional dependencies # install additional dependencies
RUN apk --no-cache add \ RUN apt-get update && apt-get install -y \
pandoc \ assimp-utils \
texlive \ calibre \
texlive-xetex \ dcraw \
texmf-dist-latexextra \
ffmpeg \ ffmpeg \
graphicsmagick \
ghostscript \ ghostscript \
vips-tools \ graphicsmagick \
vips-poppler \
vips-jxl \
vips-heif \
vips-magick \
libjxl-tools \
assimp \
inkscape \ inkscape \
libheif-examples \
libjxl-tools \
libva2 \
libvips-tools \
pandoc \
poppler-utils \ poppler-utils \
gcompat \ potrace \
libva-utils \ python3-numpy \
py3-numpy \ resvg \
potrace texlive \
texlive-latex-extra \
# RUN apk --no-cache add calibre@testing --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main/ texlive-xetex \
--no-install-recommends \
# this might be needed for some latex use cases, will add it if needed. && rm -rf /var/lib/apt/lists/*
# texmf-dist-fontsextra \
COPY --from=install /temp/prod/node_modules node_modules COPY --from=install /temp/prod/node_modules node_modules
COPY --from=builder /root/.cargo/bin/resvg /usr/local/bin/resvg
COPY --from=prerelease /app/public/generated.css /app/public/ COPY --from=prerelease /app/public/generated.css /app/public/
COPY . . COPY . .