Skip to content

Commit 61fbd8c

Browse files
switch to pdfLatex
1 parent d9ebce8 commit 61fbd8c

File tree

2 files changed

+39
-20
lines changed

2 files changed

+39
-20
lines changed

.docker/Dockerfile

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,38 @@
1-
FROM ubuntu:22.04
1+
# Stage 1: Builder with all necessary packages
2+
FROM alpine:latest AS builder
23

3-
# Avoid prompts from apt
4-
ENV DEBIAN_FRONTEND=noninteractive
4+
# Install build dependencies in a single layer to optimize caching
5+
RUN apk add --no-cache \
6+
texlive \
7+
texlive-xetex \
8+
texmf-dist \
9+
texmf-dist-latexextra \
10+
texmf-dist-fontsextra \
11+
perl \
12+
fontconfig \
13+
make \
14+
&& texhash
515

6-
# Install required packages
7-
RUN apt-get update && apt-get install -y \
8-
texlive-full \
9-
latexmk \
10-
&& rm -rf /var/lib/apt/lists/*
16+
# Stage 2: Final image with only runtime dependencies
17+
FROM alpine:latest
18+
19+
# Install minimal runtime dependencies
20+
RUN apk add --no-cache \
21+
texlive-xetex \
22+
texmf-dist \
23+
fontconfig
24+
25+
# Copy texmf files from builder
26+
COPY --from=builder /usr/share/texmf-dist /usr/share/texmf-dist
1127

12-
# Create a working directory
1328
WORKDIR /latex
1429

15-
# Copy compilation script
30+
# Copy your LaTeX files
1631
COPY entrypoint.sh /entrypoint.sh
17-
RUN chmod +x /entrypoint.sh
32+
COPY *.tex *.cls *.sty ./
33+
34+
# Make entrypoint executable and refresh TeX file database
35+
RUN chmod +x /entrypoint.sh && \
36+
texhash
1837

1938
ENTRYPOINT ["/entrypoint.sh"]

.docker/entrypoint.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ mkdir -p /latex/output
77
# Ensure TeX can find the files
88
texhash
99

10-
# Run XeLaTeX with proper output name
11-
xelatex -interaction=nonstopmode \
12-
-output-directory=/latex/output \
13-
-jobname="Anish_Shobith_P_S_Resume" \
14-
"main.tex"
10+
# Run pdfLaTeX with proper output name
11+
pdflatex -interaction=nonstopmode \
12+
-output-directory=/latex/output \
13+
-jobname="Anish_Shobith_P_S_Resume" \
14+
"main.tex"
1515

1616
# Run again for references if needed
1717
if grep -q "Rerun to get" "/latex/output/Anish_Shobith_P_S_Resume.log"; then
18-
xelatex -interaction=nonstopmode \
19-
-output-directory=/latex/output \
20-
-jobname="Anish_Shobith_P_S_Resume" \
21-
"main.tex"
18+
pdflatex -interaction=nonstopmode \
19+
-output-directory=/latex/output \
20+
-jobname="Anish_Shobith_P_S_Resume" \
21+
"main.tex"
2222
fi
2323

2424
# Copy the final PDF to the mounted volume

0 commit comments

Comments
 (0)