diff --git a/README.md b/README.md index 9548621..525c52a 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,7 @@ A collection of delicious docker recipes. - [x] nullmailer-arm - [x] openhab - [x] openssh +- [x] ot-frontend-arm - [x] ot-recorder - [x] ot-recorder-arm - [x] piknik diff --git a/ot-frontend/arm/Dockerfile b/ot-frontend/arm/Dockerfile new file mode 100644 index 0000000..bcb5a1d --- /dev/null +++ b/ot-frontend/arm/Dockerfile @@ -0,0 +1,38 @@ +# +# Dockerfile for ot-frontend-arm +# + +FROM arm32v7/alpine:3 +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 + +ENV LISTEN_PORT=80 +ENV SERVER_HOST=otrecorder +ENV SERVER_PORT=8083 + +EXPOSE 80 + +CMD set -xe \ + && envsubst '${SERVER_HOST}:${SERVER_PORT}' < /etc/nginx/nginx.tmpl > /etc/nginx/nginx.conf \ + && nginx -g 'daemon off;' diff --git a/ot-recorder/arm/docker-compose.yml b/ot-recorder/arm/docker-compose.yml index abbb8ca..df67d5a 100644 --- a/ot-recorder/arm/docker-compose.yml +++ b/ot-recorder/arm/docker-compose.yml @@ -1,16 +1,29 @@ -ot-recorder: - image: easypi/ot-recorder-arm - ports: - - "8083:8083" - volumes: - - ./data:/var/spool/owntracks/recorder/store - environment: - - OTR_HOST=iot.eclipse.org - - OTR_PORT=8883 - - OTR_USER=username - - OTR_PASS=password - - OTR_CAFILE=/etc/ssl/certs/DST_Root_CA_X3.pem - - OTR_TOPICS=owntracks/# - # OTR_BROWSERAPIKEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - # OTR_OPTIONS=--debug - restart: always +version: "3.7" + +services: + + recorder: + image: easypi/ot-recorder-arm + ports: + - "8083:8083" + volumes: + - ./data:/var/spool/owntracks/recorder/store + environment: + - OTR_HOST=iot.eclipse.org + - OTR_PORT=8883 + - OTR_USER=username + - OTR_PASS=password + - OTR_TOPICS=owntracks/# + # OTR_CAFILE=/etc/ssl/certs/DST_Root_CA_X3.pem + # OTR_OPTIONS=--debug + restart: unless-stopped + + frontend: + image: easypi/ot-frontend-arm + ports: + - 8080:80 + environment: + - LISTEN_PORT=80 + - SERVER_HOST=recorder + - SERVER_PORT=8083 + restart: unless-stopped