mirror of
https://github.com/TheRealOwenRees/chess-scribe-api.git
synced 2026-07-23 01:06:56 +00:00
build texlive server
This commit is contained in:
+27
-9
@@ -11,22 +11,40 @@ RUN opam exec -- dune build bin/main.exe
|
||||
FROM debian:12-slim
|
||||
WORKDIR /app
|
||||
|
||||
# Install native system dependencies and a minimal TeX Live profile
|
||||
# Configure apt to retry downloads up to 3 times if a packet gets corrupted
|
||||
RUN echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/80-retries
|
||||
|
||||
# 1. Install native system dependencies and a minimal TeX Live profile
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
libssl3 \
|
||||
libev4 \
|
||||
ca-certificates \
|
||||
# texlive-latex-base \
|
||||
# texlive-latex-recommended \
|
||||
# texlive-fonts-recommended \
|
||||
# # tlmgr is the TeX Live package manager; we use it to grab chess assets
|
||||
# texlive-games \
|
||||
wget \
|
||||
tar \
|
||||
perl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy the compiled native OCaml binary from Stage 1
|
||||
COPY --from=builder /app/_build/default/bin/main.exe ./server
|
||||
# 2. Download and run the TeX Live CTAN installer script
|
||||
RUN wget --tries=5 https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz && \
|
||||
tar -xzf install-tl-unx.tar.gz && \
|
||||
rm install-tl-unx.tar.gz && \
|
||||
cd install-tl-* && \
|
||||
echo "selected_scheme scheme-basic" > profile && \
|
||||
./install-tl -profile profile && \
|
||||
cd .. && \
|
||||
rm -rf install-tl-*
|
||||
|
||||
# Copy the static assets folder
|
||||
# 3. FIX: Ensure the dynamic path to tlmgr matches whatever year CTAN is currently on
|
||||
ENV PATH="/usr/local/texlive/2026/bin/x86_64-linux:${PATH}"
|
||||
ENV PATH="/usr/local/texlive/2025/bin/x86_64-linux:${PATH}"
|
||||
ENV PATH="/usr/local/texlive/2024/bin/x86_64-linux:${PATH}"
|
||||
# Fallback to absolute standard binary bin location
|
||||
ENV PATH="/usr/local/texlive/bin/x86_64-linux:${PATH}"
|
||||
|
||||
# 3. Install TexLive packages needed for rendering a chess game
|
||||
RUN tlmgr install parskip pgf chessboard etoolbox ifmtarg xifthen skaknew lambda-lists xkeyval chessfss skak xskak
|
||||
|
||||
COPY --from=builder /app/_build/default/bin/main.exe ./server
|
||||
COPY ./static ./static
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
Reference in New Issue
Block a user