Files
ConvertX/Dockerfile
T

69 lines
1.7 KiB
Docker
Raw Normal View History

2025-05-22 12:28:03 +02:00
FROM debian:trixie-slim AS base
2024-08-23 19:14:06 +02:00
LABEL org.opencontainers.image.source="https://github.com/C4illin/ConvertX"
2024-05-19 23:51:27 +02:00
WORKDIR /app
2025-05-22 12:28:03 +02:00
# 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"
2024-05-19 23:51:27 +02:00
# install dependencies into temp directory
# this will cache them and speed up future builds
FROM base AS install
RUN mkdir -p /temp/dev
2025-02-01 21:09:12 +01:00
COPY package.json bun.lock /temp/dev/
2024-05-19 23:51:27 +02:00
RUN cd /temp/dev && bun install --frozen-lockfile
# install with --production (exclude devDependencies)
RUN mkdir -p /temp/prod
2025-02-01 21:09:12 +01:00
COPY package.json bun.lock /temp/prod/
2024-05-19 23:51:27 +02:00
RUN cd /temp/prod && bun install --frozen-lockfile --production
2025-03-08 01:08:00 +01:00
FROM base AS prerelease
2025-02-01 21:09:12 +01:00
WORKDIR /app
2024-09-09 17:38:03 +02:00
COPY --from=install /temp/dev/node_modules node_modules
COPY . .
2024-05-19 23:51:27 +02:00
2025-02-01 21:09:12 +01:00
# ENV NODE_ENV=production
2024-09-09 17:38:03 +02:00
RUN bun run build
2024-05-19 23:51:27 +02:00
# copy production dependencies and source code into final image
FROM base AS release
2024-05-29 11:59:52 +02:00
2024-05-24 22:58:25 +02:00
# install additional dependencies
2025-05-22 12:28:03 +02:00
RUN apt-get update && apt-get install -y \
assimp-utils \
calibre \
dcraw \
2024-05-24 22:58:25 +02:00
ffmpeg \
2024-05-25 15:52:04 +02:00
ghostscript \
2025-05-22 12:28:03 +02:00
graphicsmagick \
2024-12-07 02:38:30 +01:00
inkscape \
2025-05-22 12:28:03 +02:00
libheif-examples \
libjxl-tools \
libva2 \
libvips-tools \
2025-05-23 21:18:47 +02:00
imagemagick-7.q16 \
2025-05-22 12:28:03 +02:00
pandoc \
2025-01-23 22:00:19 +01:00
poppler-utils \
2025-05-22 12:28:03 +02:00
potrace \
python3-numpy \
resvg \
texlive \
texlive-latex-extra \
texlive-xetex \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
2024-06-20 20:23:34 +02:00
2024-05-19 23:51:27 +02:00
COPY --from=install /temp/prod/node_modules node_modules
2024-10-18 19:32:42 +02:00
COPY --from=prerelease /app/public/generated.css /app/public/
2024-05-19 23:51:27 +02:00
COPY . .
EXPOSE 3000/tcp
ENV NODE_ENV=production
2024-05-19 23:51:27 +02:00
ENTRYPOINT [ "bun", "run", "./src/index.tsx" ]