1- FROM oven/bun:1.2.2-alpine AS base
1+ FROM debian:trixie-slim AS base
22LABEL org.opencontainers.image.source="https://github.com/C4illin/ConvertX"
33WORKDIR /app
44
5+ # install bun
6+ ENV BUN_INSTALL=/etc/.bun
7+ ENV PATH=$BUN_INSTALL/bin:$PATH
8+ ENV BUN_RUNTIME_TRANSPILER_CACHE_PATH=0
9+ RUN apt-get update && apt-get install -y \
10+ curl \
11+ unzip \
12+ && rm -rf /var/lib/apt/lists/*
13+ RUN curl -fsSL https://bun.sh/install | bash -s "bun-v1.2.2"
14+
515# install dependencies into temp directory
616# this will cache them and speed up future builds
717FROM base AS install
@@ -14,12 +24,6 @@ RUN mkdir -p /temp/prod
1424COPY package.json bun.lock /temp/prod/
1525RUN cd /temp/prod && bun install --frozen-lockfile --production
1626
17- FROM base AS builder
18- RUN apk --no-cache add curl gcc
19- ENV PATH=/root/.cargo/bin:$PATH
20- RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
21- RUN cargo install resvg
22-
2327FROM base AS prerelease
2428WORKDIR /app
2529COPY --from=install /temp/dev/node_modules node_modules
@@ -31,38 +35,31 @@ RUN bun run build
3135# copy production dependencies and source code into final image
3236FROM base AS release
3337
34- RUN apk --no-cache add libheif-tools --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community/
35-
3638# install additional dependencies
37- RUN apk --no-cache add \
38- pandoc \
39- texlive \
40- texlive-xetex \
41- texmf-dist-latexextra \
39+ RUN apt-get update && apt-get install -y \
40+ assimp-utils \
41+ calibre \
42+ dcraw \
4243 ffmpeg \
43- graphicsmagick \
4444 ghostscript \
45- vips-tools \
46- vips-poppler \
47- vips-jxl \
48- vips-heif \
49- vips-magick \
50- libjxl-tools \
51- assimp \
45+ graphicsmagick \
5246 inkscape \
47+ libheif-examples \
48+ libjxl-tools \
49+ libva2 \
50+ libvips-tools \
51+ pandoc \
5352 poppler-utils \
54- gcompat \
55- libva-utils \
56- py3-numpy \
57- potrace
58-
59- # RUN apk --no-cache add calibre@testing --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main/
60-
61- # this might be needed for some latex use cases, will add it if needed.
62- # texmf-dist-fontsextra \
53+ potrace \
54+ python3-numpy \
55+ resvg \
56+ texlive \
57+ texlive-latex-extra \
58+ texlive-xetex \
59+ --no-install-recommends \
60+ && rm -rf /var/lib/apt/lists/*
6361
6462COPY --from=install /temp/prod/node_modules node_modules
65- COPY --from=builder /root/.cargo/bin/resvg /usr/local/bin/resvg
6663COPY --from=prerelease /app/public/generated.css /app/public/
6764COPY . .
6865
0 commit comments