diff --git a/Dockerfile b/Dockerfile index ff90978..d2b9ea8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,31 +1,20 @@ -FROM rust:slim AS typ2docx -RUN apt update && apt install -y --no-install-recommends \ - curl pkg-config libssl-dev -RUN curl -LsSf https://astral.sh/uv/install.sh | sh +FROM rust:alpine AS typ2docx +RUN apk add --no-cache pkgconfig openssl-dev gcompat COPY pyproject.toml / -RUN /root/.local/bin/uv tool install typ2docx --verbose +RUN uv tool install typ2docx --python-platform x86_64-manylinux_2_40 --verbose -# align with oven/bun:slim -FROM rust:slim-bookworm AS typst -RUN apt update && apt install -y --no-install-recommends pkg-config libssl-dev -COPY Cargo.toml / -RUN cargo install typst-cli +FROM alpine:edge AS typst +RUN apk add --no-cache typst -FROM alpine/curl AS pandoc -ARG PLATFORM=linux-amd64 -ARG REPO=https://github.com/jgm/pandoc -ARG VERSION=3.8.3 -ARG FILE=pandoc-${VERSION}-${PLATFORM}.tar.gz -RUN curl -L "${REPO}/releases/download/${VERSION}/${FILE}" | tar -xz +FROM pandoc/minimal AS pandoc -FROM oven/bun:slim -RUN apt update && \ - apt install -y --no-install-recommends ca-certificates unzip rsync zip && \ - rm -rf /var/lib/apt/lists/ -COPY --from=pandoc /pandoc-*/bin/pandoc /usr/local/bin/ -COPY --from=typst /usr/local/cargo/bin/typst /usr/local/bin/ -COPY --from=typ2docx /root/.local/bin/typ2docx /usr/local/bin/ +FROM oven/bun:alpine +RUN apk add --no-cache \ + ca-certificates gcompat unzip rsync zip libxml2 +COPY --from=pandoc /usr/local/bin/pandoc /usr/bin/ +COPY --from=typst /usr/bin/typst /usr/bin/ +COPY --from=typ2docx /root/.local/bin/typ2docx /usr/bin/ COPY --from=typ2docx /root/.local/share/uv/ /root/.local/share/uv/ -COPY server.ts / -COPY index.html / -CMD ["bun", "server.ts"] +COPY server.ts ./ +COPY index.html ./ +CMD ["./server.ts"]