From 1d651e42d41f321cb66a85590272c74211d8f4e0 Mon Sep 17 00:00:00 2001 From: kev Date: Tue, 15 Sep 2020 19:06:47 +0800 Subject: [PATCH] update ot-frontend --- owntracks/ot-frontend/arm/Dockerfile | 34 +++++++++------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/owntracks/ot-frontend/arm/Dockerfile b/owntracks/ot-frontend/arm/Dockerfile index bdb3610..65ea1b5 100644 --- a/owntracks/ot-frontend/arm/Dockerfile +++ b/owntracks/ot-frontend/arm/Dockerfile @@ -2,30 +2,18 @@ # Dockerfile for ot-frontend-arm # -FROM arm32v7/alpine:3 +FROM arm32v7/node:10 AS build +WORKDIR /usr/src/app +RUN curl -sSL https://github.com/owntracks/frontend/archive/master.tar.gz | tar xz --strip-components=1 +RUN yarn install +RUN yarn build + + +FROM arm32v7/nginx:alpine MAINTAINER EasyPi Software Foundation -RUN set -xe \ - && apk add --no-cache gettext \ - && mv /usr/bin/envsubst /tmp/ \ - && runDeps="$( \ - scanelf --needed --nobanner /tmp/envsubst \ - | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ - | sort -u \ - | xargs -r apk info --installed \ - | sort -u \ - )" \ - && apk add --no-cache $runDeps \ - && apk del gettext - -RUN set -xe \ - && apk add --no-cache curl nginx \ - && mv /tmp/envsubst /usr/local/bin/ \ - && curl -sSLO https://github.com/owntracks/frontend/archive/master.tar.gz \ - && mkdir -p /usr/share/nginx/html/ \ - && tar xzf master.tar.gz --strip-components=1 -C /usr/share/nginx/html/ frontend-master/index.html frontend-master/static \ - && tar xzf master.tar.gz --strip-components=1 -C /etc/nginx/ frontend-master/nginx.tmpl \ - && rm master.tar.gz +COPY --from=build /usr/src/app/dist /usr/share/nginx/html +COPY --from=build /usr/src/app/docker/nginx.tmpl /etc/nginx/nginx.tmpl ENV LISTEN_PORT=80 ENV SERVER_HOST=otrecorder @@ -34,6 +22,6 @@ ENV SERVER_PORT=8083 EXPOSE 80 CMD set -xe \ - && envsubst '${SERVER_HOST}:${SERVER_PORT}' < /etc/nginx/nginx.tmpl > /etc/nginx/nginx.conf \ + && envsubst '${LISTEN_PORT}:${SERVER_HOST}:${SERVER_PORT}' < /etc/nginx/nginx.tmpl > /etc/nginx/nginx.conf \ && mkdir -p /run/nginx/ \ && nginx -g 'daemon off;'