Now also installs the latex compiler
This commit is contained in:
parent
81a3251c65
commit
aed2db9360
30
Dockerfile
30
Dockerfile
|
|
@ -1,4 +1,26 @@
|
|||
FROM oven/bun:alpine AS base
|
||||
# Stage 0: install and prepare TinyTex
|
||||
FROM debian:bookworm-slim AS tex-builder
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
wget perl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN wget -qO- https://yihui.org/tinytex/TinyTeX-0.tar.gz | tar -xz -C /tmp/
|
||||
|
||||
RUN /tmp/.TinyTeX/bin/x86_64-linux/tlmgr install \
|
||||
latex-bin \
|
||||
pdftex \
|
||||
geometry \
|
||||
pgf \
|
||||
etoolbox \
|
||||
csvsimple \
|
||||
csquotes \
|
||||
tools \
|
||||
ec \
|
||||
cm-super
|
||||
|
||||
# App starts here
|
||||
FROM oven/bun:slim AS base
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
|
@ -19,6 +41,7 @@ RUN mkdir -p /temp/prod
|
|||
COPY package.json bun.lockb /temp/prod/
|
||||
RUN cd /temp/prod && bun install --frozen-lockfile --production
|
||||
|
||||
|
||||
## Stage 2: Build app
|
||||
FROM base AS prerelease
|
||||
|
||||
|
|
@ -35,16 +58,19 @@ RUN bun run build
|
|||
FROM base AS release
|
||||
|
||||
# compose the final image
|
||||
COPY --from=tex-builder /tmp/.TinyTeX .TinyTeX
|
||||
COPY --from=install /temp/prod/node_modules node_modules
|
||||
COPY --from=prerelease /usr/src/app/build .
|
||||
COPY --from=prerelease /usr/src/app/templates ./templates
|
||||
|
||||
ENV PATH="/usr/src/app/.TinyTeX/bin/x86_64-linux:${PATH}"
|
||||
|
||||
RUN mkdir /app-data && chown bun:bun /app-data
|
||||
RUN chown -R bun:bun .TinyTeX
|
||||
|
||||
VOLUME ["/app-data"]
|
||||
|
||||
USER bun
|
||||
EXPOSE 3000/tcp
|
||||
ENTRYPOINT [ "bun", "--bun", "./index.js" ]
|
||||
#CMD [ "ls -al" ]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue