summaryrefslogtreecommitdiff
path: root/client/Dockerfile
diff options
context:
space:
mode:
authorShyam Sunder <sgsunder1@gmail.com>2018-07-24 19:53:29 -0400
committerMarcin Kurczewski <rr-@sakuya.pl>2018-08-23 21:04:19 +0200
commit565027269c124c2aa7f7045983a75a31a9242215 (patch)
treeba69161a237830936f4c9121becaacc9ee8f7f60 /client/Dockerfile
parentdefada45ab5efc7f9a0c209f364f0864d297514a (diff)
client/js/router.js: Reads <base> href tag
Diffstat (limited to 'client/Dockerfile')
-rw-r--r--client/Dockerfile6
1 files changed, 4 insertions, 2 deletions
diff --git a/client/Dockerfile b/client/Dockerfile
index 49e0ab6..69555a4 100644
--- a/client/Dockerfile
+++ b/client/Dockerfile
@@ -8,9 +8,10 @@ COPY . ./
ARG BUILD_INFO="docker-latest"
ARG CLIENT_BUILD_ARGS=""
-RUN node build.js ${CLIENT_BUILD_ARGS}
+RUN BASE_URL="__BASEURL__" node build.js ${CLIENT_BUILD_ARGS}
-RUN find public/ -type f -size +5k -print0 | xargs -0 -- gzip -6 -k
+RUN find public/ -name public/index.html -prune -o -type f -size +5k \
+ -print0 | xargs -0 -- gzip -6 -k
FROM nginx:alpine
@@ -21,6 +22,7 @@ RUN \
echo "#!/bin/sh" >> /init && \
echo 'sed -i "s|__BACKEND__|${BACKEND_HOST}|" /etc/nginx/nginx.conf' \
>> /init && \
+ echo 'sed -i "s|__BASEURL__|${BASE_URL:-/}|" /var/www/index.htm' >> /init && \
echo 'exec nginx -g "daemon off;"' >> /init && \
chmod a+x /init