From e7834cd4eeb8a98636cc556dcf428a11b9e899d9 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Tue, 28 Feb 2017 00:09:11 +0100 Subject: [PATCH] make the docker build actually working --- .gitmodules | 3 +++ client/Dockerfile | 2 +- client/api.conf | 22 +++++++++++++++------- server/Dockerfile | 27 +++++++++++++++++++++++++-- server/texmf | 1 + 5 files changed, 45 insertions(+), 10 deletions(-) create mode 100644 .gitmodules create mode 160000 server/texmf diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..103c711 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "server/texmf"] + path = server/texmf + url = git@gitlab.com:tomru/tex-local-packages.git diff --git a/client/Dockerfile b/client/Dockerfile index df16308..3c53782 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -1,3 +1,3 @@ FROM nginx:alpine COPY ./build /usr/share/nginx/html -COPY ./api.conf /etc/nginx/conf.d/ +COPY ./api.conf /etc/nginx/conf.d/default.conf diff --git a/client/api.conf b/client/api.conf index 31e29b9..bb3dc34 100644 --- a/client/api.conf +++ b/client/api.conf @@ -1,11 +1,19 @@ server { - location /api/ { + listen 80; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + location /api { proxy_pass http://backend:5000; - proxy_redirect default; - - proxy_read_timeout 241s; - - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; } } diff --git a/server/Dockerfile b/server/Dockerfile index 423e34f..6ab7267 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -1,4 +1,27 @@ -FROM mhart/alpine-node:7.6 +FROM base/archlinux +MAINTAINER Thomas Ruoff + +# basics +RUN pacman -Syu --noconfirm sed grep awk + +# texlive +RUN pacman -S --noconfirm texlive-core texlive-latexextra + +# TODO: move up later +RUN pacman -S --noconfirm tar gzip + +# node +RUN pacman -S --noconfirm nodejs npm + +# private tex things +ADD ./texmf/tex/latex/* /usr/share/texmf/tex/latex/ + +# fix font map file issue +RUN updmap + ADD . /code WORKDIR /code -CMD ["node", "index.js"] + +RUN npm install --production + +CMD node index.js diff --git a/server/texmf b/server/texmf new file mode 160000 index 0000000..f5a8fe0 --- /dev/null +++ b/server/texmf @@ -0,0 +1 @@ +Subproject commit f5a8fe0ed07a5f0ecffd1458131ac172fb759e0e