-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1c57300
commit d9ebce8
Showing
1 changed file
with
10 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,19 @@ | ||
# Stage 1: Builder with all necessary packages | ||
FROM ubuntu:latest AS builder | ||
FROM ubuntu:22.04 | ||
|
||
# Install build dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
texlive-full \ | ||
perl \ | ||
fontconfig \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
# Avoid prompts from apt | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Stage 2: Final image with only runtime dependencies | ||
FROM ubuntu:latest | ||
|
||
# Install minimal runtime dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
texlive-xetex \ | ||
texlive-fonts-recommended \ | ||
texlive-pictures \ | ||
fontconfig \ | ||
# Install required packages | ||
RUN apt-get update && apt-get install -y \ | ||
texlive-full \ | ||
latexmk \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy texmf files from builder | ||
COPY --from=builder /usr/share/texmf-dist /usr/share/texmf-dist | ||
|
||
# Create a working directory | ||
WORKDIR /latex | ||
|
||
# Copy your LaTeX files | ||
# Copy compilation script | ||
COPY entrypoint.sh /entrypoint.sh | ||
COPY *.tex *.cls *.sty ./ | ||
|
||
# Make entrypoint executable and refresh TeX file database | ||
RUN chmod +x /entrypoint.sh && \ | ||
texhash | ||
RUN chmod +x /entrypoint.sh | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |