## Common Templates x-klipper-svc: &klipper-svc 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 ## Service Definitions services: ## Klippy Services ## klipper: <<: *klipper-svc volumes: - ./config:/opt/printer_data/config - run:/opt/printer_data/run - gcode:/opt/printer_data/gcodes - log:/opt/printer_data/logs profiles: - fluidd - mainsail - klipperscreen klipper-priv: <<: *klipper-svc privileged: true volumes: - /dev:/dev - ./config:/opt/printer_data/config - run:/opt/printer_data/run - gcode:/opt/printer_data/gcodes - log:/opt/printer_data/logs profiles: - octoprint ## WebApi ## 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 - ./config:/opt/printer_data/config profiles: - fluidd - mainsail - klipperscreen 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" ## Frontends ## octoprint: image: octoprint/octoprint:minimal restart: unless-stopped depends_on: klipper-priv: condition: service_started privileged: true volumes: - /dev:/dev - run:/opt/printer_data/run - octoprint:/octoprint - ./config/octoprint.yaml:/octoprint/octoprint/config.yaml profiles: - octoprint labels: - "traefik.enable=true" - "traefik.http.services.octoprint.loadbalancer.server.port=5000" - "traefik.http.routers.octoprint.rule=PathPrefix(`/`)" - "traefik.http.routers.octoprint.entrypoints=web" fluidd: image: cadriel/fluidd:latest restart: unless-stopped profiles: - fluidd labels: - "traefik.enable=true" - "traefik.http.services.fluidd.loadbalancer.server.port=80" - "traefik.http.routers.fluidd.rule=PathPrefix(`/`)" - "traefik.http.routers.fluidd.entrypoints=web" mainsail: image: ghcr.io/mainsail-crew/mainsail:edge restart: unless-stopped profiles: - mainsail labels: - "traefik.enable=true" - "traefik.http.services.mainsail.loadbalancer.server.port=80" - "traefik.http.routers.mainsail.rule=PathPrefix(`/`)" - "traefik.http.routers.mainsail.entrypoints=web" klipperscreen: image: mkuf/klipperscreen:latest restart: unless-stopped network_mode: host profiles: - klipperscreen volumes: - /etc/localtime:/etc/localtime:ro - /tmp/.X11-unix:/tmp/.X11-unix - ./config:/opt/cfg ## Accompanying Services/Infra ## ## Config dir needs to be writable by uid/gid 1000 ## This container sets the right permissions and exits init: image: busybox:latest command: chown -R 1000:1000 /prind/config volumes: - .:/prind ## Loadbalancer/Proxy 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: octoprint: moonraker-db: log: driver_opts: type: tmpfs device: tmpfs