Browse Source

UI from mictronics/dump1090 in an nginx container for use in my dump1090 rig

sungo 10 months ago
parent
commit
d99e6fd244
2 changed files with 54 additions and 0 deletions
  1. 13 0
      mictronics-dump1090-ui/Dockerfile
  2. 41 0
      mictronics-dump1090-ui/nginx.conf

+ 13 - 0
mictronics-dump1090-ui/Dockerfile

@@ -0,0 +1,13 @@
+FROM nginx:alpine
+
+RUN apk add --no-cache --update git ca-certificates 
+WORKDIR /tmp
+RUN git clone --depth 1 https://github.com/Mictronics/dump1090.git
+RUN mv dump1090/public_html/* /usr/share/nginx/html
+RUN rm -rf dump1090
+
+WORKDIR /usr/share/nginx/html
+RUN cp config.example.js config.js
+
+COPY nginx.conf /etc/nginx/nginx.conf
+

+ 41 - 0
mictronics-dump1090-ui/nginx.conf

@@ -0,0 +1,41 @@
+events {
+    worker_connections 1024;
+}
+
+http {
+    include       mime.types;
+    default_type  application/octet-stream;
+
+    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
+                      '$status $body_bytes_sent "$http_referer" '
+                      '"$http_user_agent" "$http_x_forwarded_for"';
+
+    access_log stderr main;
+    error_log stderr warn;
+
+    sendfile        on;
+    keepalive_timeout  0;
+
+    server {
+        listen       80;
+        server_name  _;
+
+        location / {
+            root   /usr/share/nginx/html;
+            index  index.html;
+        }
+
+        location /data/aircraft.json {
+            proxy_pass http://sbshttp:8000/data/aircraft.json;
+        }
+
+        location /data/receiver.json {
+            proxy_pass http://sbshttp:8000/data/receiver.json;
+        }
+
+        location /data/stats.json {
+            proxy_pass http://sbshttp:8000/data/stats.json;
+        }
+
+    }
+}