Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/image-build-and-publish-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
- docker/moonraker/**
ustreamer:
- docker/ustreamer/**
laserweb:
- docker/laserweb/**
build:
needs: changes
if: ${{ needs.changes.outputs.apps != '' && toJson(fromJson(needs.changes.outputs.apps)) != '[]' }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/image-build-and-publish-schedule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
- klipperscreen
- moonraker
- ustreamer
- laserweb
runs-on: ubuntu-24.04
steps:
- name: "[prind] checkout"
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/image-build-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ jobs:
- .github/workflows/image-build-review.yaml
- scripts/build/**
- docker/ustreamer/**
laserweb:
- .github/actions/**
- .github/workflows/image-build-review.yaml
- scripts/build/**
- docker/laserweb/**
build:
needs: changes
if: ${{ needs.changes.outputs.apps != '' && toJson(fromJson(needs.changes.outputs.apps)) != '[]' }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/image-docs-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
ustreamer:
- .github/workflows/image-docs-publish.yaml
- docker/moonraker/README.md
laserweb:
- .github/workflows/image-docs-publish.yaml
- docker/laserweb/README.md
dockerhub-description:
needs: changes
if: ${{ needs.changes.outputs.apps != '' && toJson(fromJson(needs.changes.outputs.apps)) != '[]' }}
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
<!--
## [Unreleased]
### Added
* **New Service:** LaserWeb4 #239
### Fixed
### Changed
### Removed
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ With a single command, you can start up Klipper and its accompanying application
|<img src="https://raw.githubusercontent.com/Donkie/Spoolman/master/client/icons/spoolman.svg" width=30px>|[Spoolman](https://github.com/Donkie/Spoolman)|`upstream`|[Additional Profiles](#spoolman)|
|<img src="https://avatars.githubusercontent.com/u/41749659?s=200&v=4" width=30px>|[µStreamer](https://github.com/pikvm/ustreamer)|prind @ [docker/ustreamer](docker/ustreamer)|[Add your Configuration](#add-your-configuration-to-docker-composeoverrideyaml)<br>[Multiple Webcams](https://github.com/mkuf/prind?tab=readme-ov-file#multiple-webcams)|
|<img src="https://octoeverywhere.com/img/logo/logo_maskable.svg" width=30px>|[OctoEverywhere](https://octoeverywhere.com)|`upstream`|[Additional Profiles](#octoeverywhere)|
|<img src="https://raw.githubusercontent.com/ssendev/LaserWeb4/refs/heads/v4.1/src/favicon.ico" width=30px>|[LaserWeb4](https://laserweb.yurl.ch/)|prind @ [docker/laserweb](docker/laserweb)|[Additional Profiles](#laserweb)|

</details>

Expand Down Expand Up @@ -245,6 +246,17 @@ After the stack has started, get the logs of the octoeverywhere service to retri
docker compose logs octoeverywhere
```

#### laserweb

[LaserWeb4](https://laserweb.yurl.ch/) can be enabled via the `laserweb` Profile. The image is based on [a fork](https://github.com/ssendev/LaserWeb4) which includes support for connecting to Moonraker.

```
docker compose --profile fluidd --profile laserweb up -d
```

After the stack has started, navigate to `http://<yourprinter>/laserweb/`.
In the `Comms` tab, select `SERVER: Moonraker`, add your Printers IP Address as `SERVER IP` and click `Connect`

## Updating
Images are built daily and tagged with `latest` and the [git description](https://git-scm.com/docs/git-describe#_examples) of the remote repo.
Example:
Expand Down
14 changes: 14 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,20 @@ services:
labels:
org.prind.service: octoeverywhere

laserweb:
image: mkuf/laserweb:latest
restart: unless-stopped
profiles:
- laserweb
labels:
org.prind.service: laserweb
traefik.enable: true
traefik.http.services.laserweb.loadbalancer.server.port: 80
traefik.http.routers.laserweb.rule: PathPrefix(`/laserweb`)
traefik.http.routers.laserweb.entrypoints: web
traefik.http.routers.laserweb.middlewares: strip-laserweb@docker
traefik.http.middlewares.strip-laserweb.stripprefix.prefixes: /laserweb

## Accompanying Services/Infra
##

Expand Down
20 changes: 20 additions & 0 deletions docker/laserweb/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM --platform=$BUILDPLATFORM node:22-bookworm AS build

ARG REPO=https://github.com/ssendev/LaserWeb4
ARG VERSION=v4.1

WORKDIR /opt
RUN git clone ${REPO} laserweb \
&& cd laserweb \
&& git checkout ${VERSION} \
&& git submodule init \
&& git submodule update

WORKDIR /opt/laserweb
RUN npm ci --force
RUN npm run bundle-prod

FROM nginx:alpine AS run

COPY --from=build /opt/laserweb/dist /usr/share/nginx/html
RUN chown -R nginx:nginx /usr/share/nginx/html
52 changes: 52 additions & 0 deletions docker/laserweb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
This Image is built and used by [prind](.).

# Laserweb4 packaged in Docker
## What is Laserweb?

> LaserWeb / CNCWeb is a full CAM & Machine Control Program for Laser/CNC/Plotter/Plasma applications.

_via https://laserweb.yurl.ch/_

This image contains the frontend from https://github.com/ssendev/LaserWeb4.
It still requires a compatible backend like [moonraker](https://github.com/Arksine/moonraker) or the [lw.comm-server](https://github.com/LaserWeb/lw.comm-server) if machine control is desired.

## Usage
#### Run
```bash
docker run -p 80:80 mkuf/laserweb:latest
```
#### Compose
```yaml
services:
laserweb:
image: mkuf/laserweb:latest
ports:
- "80:80"
```
## Defaults
|Entity|Description|
|---|---|
|User| `nginx (101:101)` |
|Workdir||
|Entrypoint|`/docker-entrypoint.sh`|
|Cmd|`nginx -g daemon off;`|

## Ports
|Port|Description|
|---|---|
|`80/tcp`|Default HTTP Port|

## Volumes
none

## Tags
|Tag|Description|Static|
|---|---|---|
|`latest`|Refers to the most recent runtime Image.|May point to a new build within 24h, depending on code changes in the upstream repository.|
|`<git description>` <br>eg: `v4.1-1-g3c7564d`|Refers to a specific git description in the upstream repository. |Yes|

## Targets
|Target|Description|Pushed|
|---|---|---|
|`build`|Pull Upstream Codebase and build application|No|
|`run`|Default runtime Image based on `library/nginx`|Yes|
41 changes: 31 additions & 10 deletions scripts/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@
context = "docker/" + args.app
dockerfile = context + "/Dockerfile"
build = {
"upstream": None,
"upstream": {
"url": None,
"ref": None
},
"targets": [],
"versions": {},
"summary": {
Expand Down Expand Up @@ -85,7 +88,12 @@
# upstream repository url
repo = re.findall(r'ARG REPO.*', line)
if repo:
build["upstream"] = repo[0].split('=')[1]
build["upstream"]["url"] = repo[0].split('=')[1]

# upstream version
ref = re.findall(r'ARG VERSION.*', line)
if ref:
build["upstream"]["ref"] = ref[0].split('=')[1]

# build targets
target = re.findall(r'FROM .* AS .*', line)
Expand All @@ -95,9 +103,9 @@

if args.upstream:
logger.warning("Upstream Repo has been overwritten to: " + args.upstream )
build["upstream"] = args.upstream
build["upstream"]["url"] = args.upstream
else:
logger.info("Found upstream repository: " + build["upstream"])
logger.info("Found upstream repository: " + build["upstream"]["url"])

if len(build["targets"]) < 1:
logger.error("No targets found. Nothing to build")
Expand All @@ -115,16 +123,29 @@
# extract info from upstream
logger.info("Cloning Upstream repository")
tmp = tempfile.TemporaryDirectory()
upstream_repo = git.Repo.clone_from(build["upstream"], tmp.name)
upstream_repo = git.Repo.clone_from(build["upstream"]["url"], tmp.name)

logger.info("Generating Versions from Upstream repository")
## latest
latest_version = upstream_repo.git.describe("--tags")
try:
## latest
latest_version = upstream_repo.git.describe("--tags")
except:
## if latest does not exist, use VERSION from dockerfile
logger.warning("Upstream has no tags, using " + build["upstream"]["ref"] + " as latest")
latest_version = build["upstream"]["ref"]
build["versions"][latest_version] = { "latest": True }

## tags
upstream_repo_sorted_tags = upstream_repo.git.tag("-l", "--sort=v:refname").split('\n')
for i in range(1,args.backfill+1):
upstream_repo_sorted_tags = upstream_repo.git.tag("-l", "--sort=v:refname").splitlines()
upstream_repo_number_of_tags = len(upstream_repo_sorted_tags)

if upstream_repo_number_of_tags < args.backfill:
logger.warning("Requested backfill is higher than the number of upstream tags. Limiting backfill to " + str(upstream_repo_number_of_tags))
backfill = upstream_repo_number_of_tags
else:
backfill = args.backfill

for i in range(1,backfill+1):
tag = upstream_repo_sorted_tags[-abs(i)]
if tag not in build["versions"].keys():
build["versions"][tag] = { "latest": False }
Expand Down Expand Up @@ -171,7 +192,7 @@
docker.buildx.build(
# Build specific
context_path = context,
build_args = {"REPO": build["upstream"], "VERSION": version},
build_args = {"REPO": build["upstream"]["url"], "VERSION": version},
platforms = args.platform,
target = target,
push = args.push,
Expand Down
Loading