-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.build
36 lines (23 loc) · 986 Bytes
/
Dockerfile.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM rust:slim AS rust-builder
COPY . .
RUN apt update
RUN apt install -y curl g++ libssl-dev libfontconfig-dev libharfbuzz-dev
RUN rustup default nightly
RUN cargo install --locked --path .
FROM rust:slim AS texlive-builder
COPY scripts/install_texlive_bundle.rs .
RUN apt update
RUN apt install -y curl g++ libssl-dev libfontconfig-dev libharfbuzz-dev
RUN rustup default nightly
RUN cargo -Zscript install_texlive_bundle.rs
FROM debian:bookworm-slim
ENV HOME=/home/user
ENV PATH=$HOME/app:$PATH
RUN useradd -m -u 1000 user && apt update && apt install -y ca-certificates && rm -r /var/lib/apt/lists/*
USER user
WORKDIR $HOME/app
COPY --chown=user --from=texlive-builder /root/.cache/Tectonic $HOME/.cache/Tectonic
COPY --chown=user --from=rust-builder /etc/fonts /etc/fonts
COPY --chown=user --from=rust-builder /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
COPY --chown=user --from=rust-builder /target/release/tectonic-api $HOME/app
CMD ["tectonic-api"]