-
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
e6f57d9
commit 94edf0d
Showing
3 changed files
with
13 additions
and
72 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,39 +1,12 @@ | ||
# Stage 1: Builder with all necessary packages | ||
FROM alpine:latest AS builder | ||
# Base image with LaTeX tools | ||
FROM pandoc/latex:latest | ||
|
||
# Install build dependencies in a single layer to optimize caching | ||
RUN apk add --no-cache --update \ | ||
texlive \ | ||
texlive-pdftex \ | ||
texmf-dist-latexextra \ | ||
texmf-dist-fontsextra \ | ||
fontconfig \ | ||
perl \ | ||
make \ | ||
&& texhash | ||
# Update TeX Live Manager and install required packages | ||
RUN tlmgr update --self && \ | ||
tlmgr install enumitem titlesec xcharter etoolbox xstring geometry fancyhdr xkeyval fontaxes | ||
|
||
# Stage 2: Final image with only runtime dependencies | ||
FROM alpine:latest | ||
# Default working directory | ||
WORKDIR /data | ||
|
||
# Install minimal runtime dependencies for LaTeX compilation | ||
RUN apk add --no-cache --update \ | ||
texlive-pdftex \ | ||
texmf-dist-latexextra \ | ||
texmf-dist-fontsextra \ | ||
fontconfig | ||
|
||
# Copy only required texmf directories from builder to minimize image size | ||
COPY --from=builder /usr/share/texmf-dist /usr/share/texmf-dist | ||
|
||
# Set working directory | ||
WORKDIR /latex | ||
|
||
# Copy your LaTeX files and entrypoint script | ||
COPY entrypoint.sh /entrypoint.sh | ||
COPY *.tex *.cls *.sty ./ | ||
|
||
# Make entrypoint executable and refresh TeX file database | ||
RUN chmod +x /entrypoint.sh && texhash | ||
|
||
# Set default entrypoint | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
# Set pdflatex as the default entrypoint | ||
ENTRYPOINT ["pdflatex"] |
This file was deleted.
Oops, something went wrong.
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