Files
prind/docker-compose.yaml

168 lines
3.8 KiB
YAML
Raw Normal View History

## Common Template(s)
x-klipper-svc: &klipper-svc
image: klipper:latest
build:
args:
VERSION: 319c36df52eb016667d13ab006cae3752d0212e7
dockerfile: klipper.Dockerfile
context: dockerfiles/
target: run
container_name: klipper
restart: unless-stopped
command:
- "-I"
- "run/klipper.tty"
- "-a"
- "run/klipper.sock"
- "cfg/printer.cfg"
2021-10-16 18:42:56 +02:00
## Service Definitions
version: "3.4"
2021-10-16 18:42:56 +02:00
services:
2021-10-16 21:28:14 +02:00
## Klippy Services
##
2021-10-16 18:42:56 +02:00
klipper:
<<: *klipper-svc
volumes:
- ./config:/opt/cfg
- run:/opt/run
- gcode:/opt/gcode
devices:
- /dev/ttymxc3:/dev/ttymxc3
profiles:
- fluidd
- mainsail
klipper-priv:
<<: *klipper-svc
privileged: true
volumes:
- /dev:/dev
- ./config:/opt/cfg
- run:/opt/run
- gcode:/opt/gcode
profiles:
- octoprint
## WebApi
##
moonraker:
image: moonraker:latest
2021-10-16 18:42:56 +02:00
build:
dockerfile: moonraker.Dockerfile
2021-10-17 18:16:58 +02:00
context: dockerfiles/
target: run
container_name: moonraker
2021-10-16 18:42:56 +02:00
restart: unless-stopped
command:
- "-c"
- "cfg/moonraker.cfg"
depends_on:
- klipper
2021-10-16 18:42:56 +02:00
volumes:
- ./config:/opt/cfg
2021-10-16 18:42:56 +02:00
- run:/opt/run
2021-10-16 21:28:14 +02:00
- gcode:/opt/gcode
- moonraker-db:/opt/db
profiles:
- fluidd
- mainsail
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"
2021-10-16 18:42:56 +02:00
## Frontends
##
octoprint:
image: octoprint/octoprint:1-minimal
container_name: octoprint
2021-10-16 21:28:14 +02:00
restart: unless-stopped
depends_on:
- klipper-priv
- ustreamer
- traefik
privileged: true
2021-10-16 21:28:14 +02:00
volumes:
- /dev:/dev
2021-10-16 21:28:14 +02:00
- run:/opt/run
- octoprint:/octoprint
profiles:
- octoprint
2021-10-17 15:32:04 +02:00
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
container_name: fluidd
restart: unless-stopped
depends_on:
- moonraker
- ustreamer
- traefik
profiles:
- fluidd
## Fluidd needs to be the root path https://github.com/cadriel/fluidd/issues/347
labels:
- "traefik.enable=true"
- "traefik.http.services.fluidd.loadbalancer.server.port=80"
- "traefik.http.routers.fluidd.rule=PathPrefix(`/`)"
- "traefik.http.routers.fluidd.entrypoints=web"
## Accompanying Services/Infra
##
2021-10-16 21:28:14 +02:00
## Webcam Service
ustreamer:
image: ustreamer:latest
build:
dockerfile: ustreamer.Dockerfile
2021-10-17 18:16:58 +02:00
context: dockerfiles/
target: run
container_name: ustreamer
restart: unless-stopped
command:
- "--host=0.0.0.0"
- "--port=8080"
- "--slowdown"
- "--device=/dev/video0"
- "--resolution=1280x960"
- "--format=MJPEG"
- "--desired-fps=30"
depends_on:
- traefik
devices:
- /dev/video0:/dev/video0
2021-10-17 15:32:04 +02:00
labels:
- "traefik.enable=true"
- "traefik.http.services.ustreamer.loadbalancer.server.port=8080"
- "traefik.http.routers.ustreamer.rule=PathPrefix(`/stream`)"
- "traefik.http.routers.ustreamer.entrypoints=web"
2021-10-17 15:32:04 +02:00
## Loadbalancer/Proxy
2021-10-17 15:32:04 +02:00
traefik:
image: "traefik:v2.2"
container_name: "traefik"
hostname: "traefik"
2021-10-17 15:32:04 +02:00
command:
- "--accesslog"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
2021-10-17 15:32:04 +02:00
ports:
- "80:80"
2021-10-17 15:32:04 +02:00
restart: unless-stopped
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
2021-10-16 18:42:56 +02:00
volumes:
run:
2021-10-16 21:28:14 +02:00
gcode:
octoprint:
moonraker-db: