1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2025-02-03 13:21:49 +02:00

update ot-frontend

This commit is contained in:
kev 2020-09-15 19:06:47 +08:00
parent 992cf9db8e
commit 1d651e42d4

View File

@ -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;'