mirror of
https://github.com/mkuf/prind.git
synced 2025-10-26 07:46:19 +01:00
140 lines
3.9 KiB
YAML
140 lines
3.9 KiB
YAML
## Usecase: Minimal Configuration to be used with Portainer
|
|
## Issue: https://github.com/mkuf/prind/issues/39
|
|
##
|
|
## Assumptions:
|
|
## * I want to manage my printers software via portainer
|
|
## * I have shell access to the host running portainer
|
|
## * My printers Serial port is /dev/ttyUSB0
|
|
## * My printers Webcam device is /dev/video0
|
|
##
|
|
## About this setup:
|
|
## * traefik is used as proxy for the web frontend, moonraker and the webcam service
|
|
## * fluidd is used as frontend
|
|
##
|
|
## Setup:
|
|
## 1. Check out prind to a permanent directory
|
|
## > git clone https://github.com/mkuf/prind/ /data/prind
|
|
## 2. Change permissions for the prind directory
|
|
## > chown -R 1000:1000 /data/prind
|
|
## 3. Update the Devices used for klipper and the webcam service
|
|
## 4. Upload this file to portainer
|
|
|
|
services:
|
|
klipper:
|
|
image: mkuf/klipper:latest
|
|
restart: unless-stopped
|
|
privileged: true
|
|
logging:
|
|
driver: none
|
|
depends_on:
|
|
init:
|
|
condition: service_completed_successfully
|
|
command: >
|
|
-I printer_data/run/klipper.tty
|
|
-a printer_data/run/klipper.sock
|
|
printer_data/config/printer.cfg
|
|
-l printer_data/logs/klippy.log
|
|
volumes:
|
|
- /dev:/dev
|
|
- /data/prind/config:/opt/printer_data/config
|
|
- run:/opt/printer_data/run
|
|
- gcode:/opt/printer_data/gcodes
|
|
- log:/opt/printer_data/logs
|
|
labels:
|
|
org.prind.service: klipper
|
|
|
|
moonraker:
|
|
image: mkuf/moonraker:latest
|
|
restart: unless-stopped
|
|
pid: host
|
|
logging:
|
|
driver: none
|
|
depends_on:
|
|
init:
|
|
condition: service_completed_successfully
|
|
klipper:
|
|
condition: service_started
|
|
volumes:
|
|
- /dev/null:/opt/klipper/config/null
|
|
- /dev/null:/opt/klipper/docs/null
|
|
- /run/dbus:/run/dbus
|
|
- /run/systemd:/run/systemd
|
|
- run:/opt/printer_data/run
|
|
- gcode:/opt/printer_data/gcodes
|
|
- log:/opt/printer_data/logs
|
|
- moonraker-db:/opt/printer_data/database
|
|
- /data/prind/config:/opt/printer_data/config
|
|
labels:
|
|
org.prind.service: moonraker
|
|
traefik.enable: true
|
|
traefik.http.services.moonraker.loadbalancer.server.port: 7125
|
|
traefik.http.routers.moonraker.rule: PathRegexp(`^/(websocket|printer|api|access|machine|server)`)
|
|
traefik.http.routers.moonraker.entrypoints: web
|
|
|
|
webcam:
|
|
image: mkuf/ustreamer:latest
|
|
restart: unless-stopped
|
|
command: >
|
|
--host=0.0.0.0
|
|
--port=8080
|
|
--slowdown
|
|
--device=/dev/webcam
|
|
--resolution=1280x960
|
|
--format=MJPEG
|
|
--desired-fps=30
|
|
devices:
|
|
- /dev/video0:/dev/webcam
|
|
labels:
|
|
org.prind.service: webcam
|
|
traefik.enable: true
|
|
traefik.http.services.webcam.loadbalancer.server.port: 8080
|
|
traefik.http.routers.webcam.rule: PathPrefix(`/webcam`)
|
|
traefik.http.routers.webcam.entrypoints: web
|
|
traefik.http.middlewares.webcam.stripprefix.prefixes: /webcam
|
|
traefik.http.routers.webcam.middlewares: webcam
|
|
|
|
fluidd:
|
|
image: ghcr.io/fluidd-core/fluidd:latest
|
|
restart: unless-stopped
|
|
labels:
|
|
org.prind.service: fluidd
|
|
traefik.enable: true
|
|
traefik.http.services.fluidd.loadbalancer.server.port: 80
|
|
traefik.http.routers.fluidd.rule: PathPrefix(`/`)
|
|
traefik.http.routers.fluidd.entrypoints: web
|
|
|
|
init:
|
|
image: busybox:latest
|
|
command: chown -R 1000:1000 /prind/config
|
|
volumes:
|
|
- /data/prind:/prind
|
|
labels:
|
|
org.prind.service: init
|
|
|
|
traefik:
|
|
image: traefik:3.3
|
|
command:
|
|
- "--accesslog"
|
|
- "--providers.docker=true"
|
|
- "--providers.docker.exposedbydefault=false"
|
|
- "--entrypoints.web.address=:80"
|
|
ports:
|
|
- "80:80"
|
|
restart: unless-stopped
|
|
volumes:
|
|
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
|
labels:
|
|
org.prind.service: traefik
|
|
|
|
volumes:
|
|
run:
|
|
driver_opts:
|
|
type: tmpfs
|
|
device: tmpfs
|
|
gcode:
|
|
moonraker-db:
|
|
log:
|
|
driver_opts:
|
|
type: tmpfs
|
|
device: tmpfs
|