Add nginx frontend?

This commit is contained in:
Jan-Henrik 2023-02-06 23:23:51 +01:00
parent 3d0e11159b
commit d9ee631971
4 changed files with 39 additions and 1 deletions

View file

@ -1,12 +1,15 @@
ARG BUILD_FROM=ghcr.io/hassio-addons/base-python/amd64:9.0.1
FROM ${BUILD_FROM}
RUN apk add --no-cache nginx
ADD "https://github.com/jhbruhn/ZBS_Flasher/archive/refs/heads/database_path_config.tar.gz" /src.tar.gz
RUN mkdir /src && tar xvfz /src.tar.gz -C /src --strip-components=1
RUN mv /src/CC2531_station/epaper_station_websocket/ /app
WORKDIR /app
RUN ls /src && pip install -r requirements.txt
RUN mkdir /public && cp /app/online_viewer.html /public/index.html && cp /app/no_img.jpg /public/
ADD rootfs /

View file

@ -1,10 +1,12 @@
---
name: EPaper Station
version: 1.0.0.7
version: 1.0.0.8
#image: ghcr.io/maxwinterstein/homeassistant-addon-toogoodtogo-ha-mqtt-bridge-{arch}
slug: epaper-station
description: Publish Pictures to EPaper pricetags
uart: true
ingress: true
ingress_port: 4242
arch:
- amd64
- armv7

View file

@ -0,0 +1,29 @@
daemon off;
events {
}
http {
include mime.types;
charset utf-8;
server {
server_name localhost;
listen 0.0.0.0:4242;
location / {
root /public;
}
location /ws {
proxy_pass http://localhost:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
}
}

View file

@ -0,0 +1,4 @@
#!/bin/bin/with-contenv bashio
bashio::log.info "Starting nginx..."
nginx -g "daemon off;" -c /etc/nginx/nginx.conf
bashio::log.info "nginx running."