Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker install #7

Merged
merged 9 commits into from
Sep 24, 2019
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM nginx:alpine
EXPOSE 80
ENV LISTEN_PORT=80 \
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/

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"
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,33 @@ This is a web interface for [OwnTracks](https://github.com/owntracks/recorder),

## Installation

### Manual install

Clone the repository and copy `index.html` and the `static/` directory to your server's webroot. The API is expected to be reachable under the same domain as the web interface.

### Docker

You can launch directly via Docker run like this:
```console
$ docker run -d -p 80:80 -e SERVER_HOST=otrecorder-host -e SERVER_PORT=otrecorder-port cosme/owntracks-ui
```
sharkoz marked this conversation as resolved.
Show resolved Hide resolved

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
version: '3'

services:
owntracks-ui:
image: cosme/owntracks-ui
ports:
- 80:80
environment:
- SERVER_HOST=otrecorder
- SERVER_PORT=8083
restart: unless-stopped
```

## Features

- Enable or disable multiple layers:
Expand Down
27 changes: 27 additions & 0 deletions nginx.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
worker_processes 1;
events {
worker_connections 1024;
}
http {
upstream otrecorder {
server ${SERVER_HOST}:${SERVER_PORT};
}
server {
listen ${LISTEN_PORT};
root /usr/share/nginx/html;
location /api {
proxy_pass http://otrecorder/api/;
}
location /ws {
proxy_pass http://otrecorder/ws/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
}
location / {
include /etc/nginx/mime.types;
try_files $uri $uri/index.html;
}
}
}