Made the configuration resilient and added a README.

This commit is contained in:
Michael Helfrich 2022-02-01 21:50:33 -05:00
parent ed9cf13ceb
commit 71ac305092
2 changed files with 38 additions and 6 deletions

View File

@ -57,18 +57,20 @@ RUN apt-get update && apt-get install -y \
&& apt-get purge -y --auto-remove jq unzip bzip2 \
&& apt-get autoclean \
&& groupadd slic3r \
&& useradd -g slic3r --create-home --home-dir /slic3r slic3r \
&& useradd -g slic3r --create-home --home-dir /home/slic3r slic3r \
&& mkdir -p /slic3r \
&& chown -R slic3r:slic3r /slic3r /slic3r \
&& mkdir -p /configs \
&& chown -R slic3r:slic3r /slic3r /home/slic3r /configs/ \
&& locale-gen en_US \
&& mkdir /root/.local
&& mkdir /configs/.local \
&& ln -s /configs/.config/ /home/slic3r/
COPY --from=easy-novnc-build /bin/easy-novnc /usr/local/bin/
COPY menu.xml /etc/xdg/openbox/
COPY supervisord.conf /etc/
EXPOSE 8080
VOLUME /root/
VOLUME /configs/
# It's time! Let's get to work! We use /root/ as a bindable volume for this Docker.
CMD ["sh", "-c", "chown slic3r:slic3r /root /dev/stdout && exec gosu slic3r supervisord"]
# It's time! Let's get to work! We use /configs/ as a bindable volume for Prusaslicers configurations.
CMD ["sh", "-c", "chown -R slic3r:slic3r /configs/ /dev/stdout && exec gosu slic3r supervisord"]

30
README.md Normal file
View File

@ -0,0 +1,30 @@
# Prusaslicer noVNC Docker Container
## Overview
This is a super basic noVNC build using supervisor to serve Prusaslicer in your favorite web browser. This was primarily built for users using the [popular unraid NAS software](https://unraid.net), to allow them to quickly hop in a browser, slice, and upload their favorite 3D prints.
A lot of this was branched off of dmagyar's awesome [prusaslicer-vnc-docker](https://hub.docker.com/r/dmagyar/prusaslicer-vnc-docker/) project, but I found it to be a bit complex for my needs and thought this approach would simplify things a lot.
## How to use
**In unraid**
If you're using unraid, open your Docker page and under `Template repositories`, add `https://github.com/helfrichmichael/unraid-templates` and save it. You should then be able to Add Container for prusaslicer-novnc. For unraid, the template will default to 6080 for the noVNC web instance.
**Outside of unraid**
To run this image, you can run the following command: `docker run --detach --volume=prusaslicer-novnc-data:/configs/ -p 8080:8080 -e SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt"
--name=prusaslicer-novnc prusaslicer-novnc`
This will bind `/configs/` in the container to a local volume on my machine named `prusaslicer-novnc-data`, it will bind port `8080` to `8080`, and finally, it will provide an environment variable to keep Prusaslicer happy by providing an `SSL_CERT_FILE`.
## Links
[Prusaslicer](https://www.prusa3d.com/prusaslicer/)
[Supervisor](http://supervisord.org/)
[GitHub Source](https://github.com/helfrichmichael/prusaslicer-novnc)
[Docker](https://hub.docker.com/r/mikeah/prusaslicer-novnc)