-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
99 lines (88 loc) · 2.69 KB
/
Dockerfile
File metadata and controls
99 lines (88 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Stage 1: Cache Gradle dependencies
FROM gradle:8.14-alpine AS cache
RUN mkdir -p /home/gradle/cache_home
ENV GRADLE_USER_HOME /home/gradle/cache_home
COPY build.gradle.* gradle.properties /home/gradle/app/
WORKDIR /home/gradle/app
RUN gradle clean build -i --stacktrace
# Stage 2: Build Application
FROM gradle:8.14-alpine AS build
COPY --from=cache /home/gradle/cache_home /home/gradle/.gradle
COPY . /usr/src/app/
WORKDIR /usr/src/app
COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
# Build the fat JAR, Gradle also supports shadow
# and boot JAR by default.
RUN gradle buildFatJar --no-daemon
# Stage 3: Create the Runtime Image
FROM pandoc/latex:3.9-alpine AS runtime
EXPOSE 8080:8080
RUN apk add --no-cache openjdk25-jre yq wget unzip
# 1. Install standard LaTeX packages via tlmgr (removed ms)
RUN tlmgr option docfiles 0 && \
tlmgr option srcfiles 0 && \
tlmgr install \
booktabs \
koma-script \
xkeyval \
everypage \
conv-xkv \
everyshi \
pdflscape \
graphics \
pgf \
background \
xcolor \
geometry \
babel \
babel-german \
tools \
blindtext \
paracol \
lipsum \
csquotes \
enumitem \
makecell \
lastpage \
fancyhdr \
amsmath \
amsfonts \
pdfpages \
iftex \
l3packages \
lm \
tocloft
# 2. Manually install AcroTeX from CTAN
RUN mkdir -p /tmp/acrotex && cd /tmp/acrotex && \
wget https://mirrors.ctan.org/macros/latex/contrib/acrotex.zip && \
unzip acrotex.zip && \
cd acrotex && \
tex acrotex.ins && \
tex eforms.ins && \
tex dljslib.ins && \
tex insdljs.ins && \
tex taborder.ins && \
TEXMF_LOCAL=$(kpsewhich -var-value=TEXMFLOCAL) && \
mkdir -p $TEXMF_LOCAL/tex/latex/acrotex && \
cp -r * $TEXMF_LOCAL/tex/latex/acrotex/ && \
cd /tmp/acrotex && \
wget https://mirrors.ctan.org/macros/latex/contrib/acrotex-js.zip && \
unzip acrotex-js.zip && \
cd acrotex-js && \
tex acrotex-js.ins && \
mkdir -p $TEXMF_LOCAL/tex/latex/acrotex-js && \
cp -r * $TEXMF_LOCAL/tex/latex/acrotex-js/ && \
mktexlsr && \
rm -rf /tmp/acrotex
# Define environment variables
ENV RESOURCES_BASE_PATH="/app/resources"
ENV LUA_FILTERS_BASE_PATH="/app/lua_filters"
# Set up directories
RUN mkdir -p $RESOURCES_BASE_PATH $LUA_FILTERS_BASE_PATH
# Copy artifacts from the build stage
COPY --from=build /home/gradle/src/build/libs/*.jar /app/letter-api.jar
COPY --from=build /home/gradle/src/src/main/resources/ $RESOURCES_BASE_PATH
COPY --from=build /home/gradle/src/src/main/lua_filters/ $LUA_FILTERS_BASE_PATH
WORKDIR /app/
ENTRYPOINT ["java", "-jar", "letter-api.jar"]