diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..d278aa5 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,7 @@ +{ + "image": "mcr.microsoft.com/devcontainers/universal:2", + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": {}, + "ghcr.io/devcontainers/features/desktop-lite:1": {} + } +} diff --git a/README.md b/README.md index f6cce5d..421a550 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,37 @@ docker run \ Note that PNG renderings currently still needs the X display. That limitation can go away soon due to the built-in EGL support. So this needs `--init` and run via `xvfb-run`. +## Web-based GUI (Selkies) + +For running OpenSCAD with a full graphical interface accessible via web browser, use the Selkies-based image. + +![OpenSCAD GUI via Selkies](demo-screenshots/06-csg-rotated-view.png) + +### Building + +```bash +cd openscad/trixie-selkies +docker build --build-arg JOBS=$(nproc) -t openscad-selkies:trixie . +``` + +### Running + +```bash +docker run -d \ + --name openscad-gui \ + -p 3000:3000 \ + -v $(pwd):/openscad \ + -v openscad-config:/config \ + openscad-selkies:trixie +``` + +Then open http://localhost:3000 in your web browser to access OpenSCAD. + +To stop the container: +```bash +docker stop openscad-gui && docker rm openscad-gui +``` + ## CI support, for internal use * `openscad/appimage-*` diff --git a/demo-screenshots/06-csg-rotated-view.png b/demo-screenshots/06-csg-rotated-view.png new file mode 100644 index 0000000..cbe7474 Binary files /dev/null and b/demo-screenshots/06-csg-rotated-view.png differ diff --git a/openscad/trixie-selkies/Dockerfile b/openscad/trixie-selkies/Dockerfile new file mode 100644 index 0000000..2e9c0f0 --- /dev/null +++ b/openscad/trixie-selkies/Dockerfile @@ -0,0 +1,50 @@ +# syntax=docker/dockerfile:1 + +# Use the official openscad image as source for binaries +FROM docker.io/openscad/openscad:latest AS openscad-source + +# Runtime stage with Selkies GUI +FROM ghcr.io/linuxserver/baseimage-selkies:debiantrixie + +# set version label +ARG BUILD_DATE +ARG VERSION +LABEL build_version="OpenSCAD version:- ${VERSION} Build-date:- ${BUILD_DATE}" +LABEL maintainer="docker-openscad" + +# title +ENV TITLE=OpenSCAD + +ENV DEBIAN_FRONTEND=noninteractive + +# Copy OpenSCAD binary and resources from the official image +COPY --from=openscad-source /usr/local/ /usr/local/ + +RUN \ + echo "**** add icon ****" && \ + curl -o \ + /usr/share/selkies/www/icon.png \ + https://raw.githubusercontent.com/openscad/openscad/master/icons/openscad-256.png && \ + echo "**** install runtime dependencies ****" && \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + libcairo2 libdouble-conversion3 libxml2 lib3mf1 libzip5 libharfbuzz0b \ + libboost-thread1.83.0 libboost-program-options1.83.0 libboost-filesystem1.83.0 \ + libboost-regex1.83.0 libmpfr6 libqscintilla2-qt5-15 \ + libqt5multimedia5 libqt5concurrent5 libqt5svg5 libtbb12 libglu1-mesa && \ + echo "**** cleanup ****" && \ + apt-get autoclean && \ + rm -rf \ + /var/lib/apt/lists/* \ + /var/tmp/* \ + /tmp/* + +# add local files +COPY /root / + +WORKDIR /openscad + +# ports and volumes +EXPOSE 3000 + +VOLUME /config diff --git a/openscad/trixie-selkies/root/defaults/autostart b/openscad/trixie-selkies/root/defaults/autostart new file mode 100644 index 0000000..b311040 --- /dev/null +++ b/openscad/trixie-selkies/root/defaults/autostart @@ -0,0 +1 @@ +openscad