mirror of
https://github.com/vimagick/dockerfiles.git
synced 2025-12-21 13:23:02 +01:00
update ot-frontend
This commit is contained in:
@@ -2,30 +2,18 @@
|
|||||||
# Dockerfile for ot-frontend-arm
|
# 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
|
MAINTAINER EasyPi Software Foundation
|
||||||
|
|
||||||
RUN set -xe \
|
COPY --from=build /usr/src/app/dist /usr/share/nginx/html
|
||||||
&& apk add --no-cache gettext \
|
COPY --from=build /usr/src/app/docker/nginx.tmpl /etc/nginx/nginx.tmpl
|
||||||
&& 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
|
|
||||||
|
|
||||||
ENV LISTEN_PORT=80
|
ENV LISTEN_PORT=80
|
||||||
ENV SERVER_HOST=otrecorder
|
ENV SERVER_HOST=otrecorder
|
||||||
@@ -34,6 +22,6 @@ ENV SERVER_PORT=8083
|
|||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
CMD set -xe \
|
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/ \
|
&& mkdir -p /run/nginx/ \
|
||||||
&& nginx -g 'daemon off;'
|
&& nginx -g 'daemon off;'
|
||||||
|
|||||||
Reference in New Issue
Block a user