diff --git a/Dockerfile b/Dockerfile index 5b7714b..db9ffaa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,22 @@ -FROM alpine:3.9 -RUN apk add --update --no-cache npm texlive poppler cairo bash texmf-dist-full ghostscript +FROM alpine:3.9 as latesch +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 ADD . /latex WORKDIR /latex -RUN npm install && \ - cd /tmp && \ +RUN cd /tmp && \ wget https://github.com/dawbarton/pdf2svg/archive/v0.2.3.tar.gz && \ tar -xzf v0.2.3.tar.gz && \ cd pdf2svg-0.2.3/ && \ ./configure && make && make install && \ - cd / && \ + cd /latex && \ rm -rf /tmp/pdf2svg-0.2.3/ && \ - echo "cd /latex" > /start.sh && \ - echo "bash tex2svg.sh" > /start.sh && \ - echo "npm start" >> /start.sh + bash tex2svg.sh -CMD ["bash", "/start.sh"] \ No newline at end of file + +FROM alpine:3.9 +EXPOSE 8000 +WORKDIR /latex +COPY --from=latesch /latex . +RUN apk add --update --no-cache npm && npm install +CMD ["npm", "start"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index b698e95..487a55a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,9 +2,7 @@ version: "3" services: latesch: build: . - image: docker.wiai.de/latex/build:0.4-alpine -# volumes: -# - ./:/latex + image: docker.wiai.de/latex/serve:0.5-alpine ports: - "127.0.0.1:8000:8000" # networks: diff --git a/tex2svg.sh b/tex2svg.sh index ba694f0..51072f3 100755 --- a/tex2svg.sh +++ b/tex2svg.sh @@ -6,6 +6,6 @@ for file in sections/german/*/*.tex; do pdfcrop $base.pdf pdf2svg $base.pdf $base-orig.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 done;