-
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
d9ebce8
commit 61fbd8c
Showing
2 changed files
with
39 additions
and
20 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,19 +1,38 @@ | ||
FROM ubuntu:22.04 | ||
# Stage 1: Builder with all necessary packages | ||
FROM alpine:latest AS builder | ||
|
||
# Avoid prompts from apt | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
# Install build dependencies in a single layer to optimize caching | ||
RUN apk add --no-cache \ | ||
texlive \ | ||
texlive-xetex \ | ||
texmf-dist \ | ||
texmf-dist-latexextra \ | ||
texmf-dist-fontsextra \ | ||
perl \ | ||
fontconfig \ | ||
make \ | ||
&& texhash | ||
|
||
# Install required packages | ||
RUN apt-get update && apt-get install -y \ | ||
texlive-full \ | ||
latexmk \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
# Stage 2: Final image with only runtime dependencies | ||
FROM alpine:latest | ||
|
||
# Install minimal runtime dependencies | ||
RUN apk add --no-cache \ | ||
texlive-xetex \ | ||
texmf-dist \ | ||
fontconfig | ||
|
||
# Copy texmf files from builder | ||
COPY --from=builder /usr/share/texmf-dist /usr/share/texmf-dist | ||
|
||
# Create a working directory | ||
WORKDIR /latex | ||
|
||
# Copy compilation script | ||
# Copy your LaTeX files | ||
COPY entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
COPY *.tex *.cls *.sty ./ | ||
|
||
# Make entrypoint executable and refresh TeX file database | ||
RUN chmod +x /entrypoint.sh && \ | ||
texhash | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
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