mirror of
https://github.com/mkuf/prind.git
synced 2025-11-02 19:35:50 +01:00
120 lines
3.7 KiB
YAML
120 lines
3.7 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
|
||
|
|
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
|
||
|
|
devices:
|
||
|
|
- /dev/ttyUSB0:/dev/ttyUSB0
|
||
|
|
volumes:
|
||
|
|
- /data/prind/config:/opt/printer_data/config
|
||
|
|
- run:/opt/printer_data/run
|
||
|
|
- gcode:/opt/printer_data/gcodes
|
||
|
|
- log:/opt/printer_data/logs
|
||
|
|
|
||
|
|
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:
|
||
|
|
- "traefik.enable=true"
|
||
|
|
- "traefik.http.services.moonraker.loadbalancer.server.port=7125"
|
||
|
|
- "traefik.http.routers.moonraker.rule=PathPrefix(`/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:
|
||
|
|
- "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: cadriel/fluidd:latest
|
||
|
|
restart: unless-stopped
|
||
|
|
labels:
|
||
|
|
- "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
|
||
|
|
|
||
|
|
traefik:
|
||
|
|
image: traefik:v2.5
|
||
|
|
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"
|
||
|
|
|
||
|
|
volumes:
|
||
|
|
run:
|
||
|
|
driver_opts:
|
||
|
|
type: tmpfs
|
||
|
|
device: tmpfs
|
||
|
|
gcode:
|
||
|
|
moonraker-db:
|
||
|
|
log:
|
||
|
|
driver_opts:
|
||
|
|
type: tmpfs
|
||
|
|
device: tmpfs
|