multistage: seperate latex step, sane image size again
This commit is contained in:
parent
a603a9531b
commit
13fb36746a
21
Dockerfile
21
Dockerfile
@ -1,19 +1,22 @@
|
|||||||
FROM alpine:3.9
|
FROM alpine:3.9 as latesch
|
||||||
RUN apk add --update --no-cache npm texlive poppler cairo bash texmf-dist-full ghostscript
|
RUN apk add --update --no-cache texlive poppler cairo bash texmf-dist-full ghostscript
|
||||||
RUN apk add --update --no-cache --virtual .build-deps poppler-dev cairo-dev wget build-base pkgconf
|
RUN apk add --update --no-cache --virtual .build-deps poppler-dev cairo-dev wget build-base pkgconf
|
||||||
|
|
||||||
ADD . /latex
|
ADD . /latex
|
||||||
WORKDIR /latex
|
WORKDIR /latex
|
||||||
RUN npm install && \
|
RUN cd /tmp && \
|
||||||
cd /tmp && \
|
|
||||||
wget https://github.com/dawbarton/pdf2svg/archive/v0.2.3.tar.gz && \
|
wget https://github.com/dawbarton/pdf2svg/archive/v0.2.3.tar.gz && \
|
||||||
tar -xzf v0.2.3.tar.gz && \
|
tar -xzf v0.2.3.tar.gz && \
|
||||||
cd pdf2svg-0.2.3/ && \
|
cd pdf2svg-0.2.3/ && \
|
||||||
./configure && make && make install && \
|
./configure && make && make install && \
|
||||||
cd / && \
|
cd /latex && \
|
||||||
rm -rf /tmp/pdf2svg-0.2.3/ && \
|
rm -rf /tmp/pdf2svg-0.2.3/ && \
|
||||||
echo "cd /latex" > /start.sh && \
|
bash tex2svg.sh
|
||||||
echo "bash tex2svg.sh" > /start.sh && \
|
|
||||||
echo "npm start" >> /start.sh
|
|
||||||
|
|
||||||
CMD ["bash", "/start.sh"]
|
|
||||||
|
FROM alpine:3.9
|
||||||
|
EXPOSE 8000
|
||||||
|
WORKDIR /latex
|
||||||
|
COPY --from=latesch /latex .
|
||||||
|
RUN apk add --update --no-cache npm && npm install
|
||||||
|
CMD ["npm", "start"]
|
||||||
@ -2,9 +2,7 @@ version: "3"
|
|||||||
services:
|
services:
|
||||||
latesch:
|
latesch:
|
||||||
build: .
|
build: .
|
||||||
image: docker.wiai.de/latex/build:0.4-alpine
|
image: docker.wiai.de/latex/serve:0.5-alpine
|
||||||
# volumes:
|
|
||||||
# - ./:/latex
|
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:8000:8000"
|
- "127.0.0.1:8000:8000"
|
||||||
# networks:
|
# networks:
|
||||||
|
|||||||
@ -6,6 +6,6 @@ for file in sections/german/*/*.tex; do
|
|||||||
pdfcrop $base.pdf
|
pdfcrop $base.pdf
|
||||||
pdf2svg $base.pdf $base-orig.svg
|
pdf2svg $base.pdf $base-orig.svg
|
||||||
pdf2svg $base-crop.pdf $base-crop.svg
|
pdf2svg $base-crop.pdf $base-crop.svg
|
||||||
rm -f $base.aux $base.log $base.out $base.pdf $base-crop.pdf
|
rm -f $base.aux $base.log $base.toc $base.out $base.pdf $base-crop.pdf
|
||||||
popd
|
popd
|
||||||
done;
|
done;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user