From 00bb4e7fa7410450fbfd7e3b31402d9c2e1b43cd Mon Sep 17 00:00:00 2001 From: sharkoz Date: Tue, 3 Sep 2019 14:33:38 +0200 Subject: [PATCH] Apply suggestions from code review Co-Authored-By: Linus Groh --- Dockerfile | 4 ++-- README.md | 10 ++++------ nginx.tmpl | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index f03a4d7..7e1f247 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ FROM nginx:alpine EXPOSE 80 ENV LISTEN_PORT=80 \ - SERVER_URL=otrecorder \ + SERVER_HOST=otrecorder \ SERVER_PORT=80 COPY nginx.tmpl /etc/nginx/nginx.tmpl COPY index.html /usr/share/nginx/html COPY static/ /usr/share/nginx/html/static/ RUN ls /usr/share/nginx/html/* -CMD /bin/sh -c "envsubst '\${SERVER_URL} \${SERVER_PORT} \${LISTEN_PORT}' < /etc/nginx/nginx.tmpl > /etc/nginx/nginx.conf && nginx -g 'daemon off;' || cat /etc/nginx/nginx.conf" +CMD /bin/sh -c "envsubst '\${SERVER_HOST} \${SERVER_PORT} \${LISTEN_PORT}' < /etc/nginx/nginx.tmpl > /etc/nginx/nginx.conf && nginx -g 'daemon off;' || cat /etc/nginx/nginx.conf" diff --git a/README.md b/README.md index dea54e0..d0f61ab 100644 --- a/README.md +++ b/README.md @@ -20,27 +20,25 @@ Clone the repository and copy `index.html` and the `static/` directory to your s ### Docker -You can launch directly via docker run like this : +You can launch directly via Docker run like this: ```bash docker run -d -p 80:80 -e SERVER_URL=otrecorder-url -e SERVER_PORT=otrecorder-port cosme/owntracks-ui ``` -Or you can use docker-compose (if you also run otrecorder with the default compose config, and the service is named `otrecorder`): +Or you can use `docker-compose` (if you also run the OwnTracks Recorder with the default compose config, and the service is named `otrecorder`): -``` yaml +```yaml version: '3' services: - owntracks-ui: image: cosme/owntracks-ui ports: - 80:80 environment: - - SERVER_URL=otrecorder + - SERVER_HOST=otrecorder - SERVER_PORT=8083 restart: unless-stopped - ``` ## Features diff --git a/nginx.tmpl b/nginx.tmpl index db5751c..917e71d 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -12,7 +12,7 @@ http { location /api { proxy_pass http://otrecorder/api/; } - location /ws { + location /ws { proxy_pass http://otrecorder/ws/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade;