diff --git a/Dockerfile b/Dockerfile index 29011b8..43bc899 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,11 @@ RUN apt-get update && apt-get install -y \ zlib1g-dev \ libjpeg-dev +RUN curl --output /usr/share/keyrings/nginx-keyring.gpg https://unit.nginx.org/keys/nginx-keyring.gpg && \ + echo "deb [signed-by=/usr/share/keyrings/nginx-keyring.gpg] https://packages.nginx.org/unit/ubuntu/ hirsute unit" > /etc/apt/sources.list.d/unit.list && \ + echo "deb-src [signed-by=/usr/share/keyrings/nginx-keyring.gpg] https://packages.nginx.org/unit/ubuntu/ hirsute unit" >> /etc/apt/sources.list.d/unit.list +RUN apt-get -y update && apt-get -y install unit + EXPOSE 5000 ARG tag=master diff --git a/start.sh b/start.sh index 60fbff3..cce11e9 100644 --- a/start.sh +++ b/start.sh @@ -1,2 +1,11 @@ +#Copy over Initial Printer Config cp -n /printer.cfg /home/octoprint/.octoprint/printer.cfg + +#Start Unit +unitd --no-daemon --control unix:/var/run/control-unit.sock & + +#Apply Primary Full Configuration +curl -X PUT --data-binary @/unitconfig.json --unix-socket /var/run/control-unit.sock http://localhost/config + +#Start OctoPrint and Klipper python3 /start.py \ No newline at end of file diff --git a/unitconfig.json b/unitconfig.json new file mode 100644 index 0000000..59829c3 --- /dev/null +++ b/unitconfig.json @@ -0,0 +1,18 @@ +{ + "listeners": { + "*:80": { + "pass": "routes" + } + }, + "routes": [ + { + "match": { + "uri": "*" + }, + + "action": { + "proxy": "http://127.0.0.1:5000" + } + } + ] +} \ No newline at end of file