moonraker: allow host control via systemd

This commit is contained in:
Markus Küffner
2022-03-23 23:41:51 +01:00
parent aa85c2bacf
commit b6bdc8d08f
3 changed files with 16 additions and 7 deletions

View File

@@ -7,7 +7,7 @@ klippy_uds_address: /opt/run/klipper.sock
config_path: /opt/cfg
[machine]
provider: none
provider: systemd_cli
[database]
database_path: /opt/db

View File

@@ -51,6 +51,7 @@ services:
image: mkuf/moonraker:nightly
container_name: moonraker
restart: unless-stopped
pid: host
logging:
driver: none
command:
@@ -64,11 +65,13 @@ services:
klipper:
condition: service_started
volumes:
- ./config:/opt/cfg
- /run/dbus:/run/dbus
- /run/systemd:/run/systemd
- run:/opt/run
- gcode:/opt/gcode
- log:/opt/log
- moonraker-db:/opt/db
- ./config:/opt/cfg
profiles:
- fluidd
- mainsail

View File

@@ -21,12 +21,14 @@ RUN apt update \
libopenjp2-7 \
python3-libgpiod \
curl \
libcurl4-openssl-dev \
libssl-dev \
libcurl4 \
libssl1.1 \
liblmdb0 \
libsodium-dev \
zlib1g-dev \
libsodium23 \
zlib1g \
iproute2 \
systemd \
sudo \
&& apt clean
WORKDIR /opt
@@ -39,6 +41,10 @@ RUN groupadd moonraker --gid 1000 \
&& usermod moonraker --append --groups dialout \
&& chown -R moonraker:moonraker /opt/*
RUN ln -s /bin/systemctl /sbin/shutdown \
&& ln -s /bin/systemctl /sbin/reboot \
&& echo -n "moonraker ALL = NOPASSWD: /bin/systemctl, /sbin/shutdown, /sbin/reboot" > /etc/sudoers.d/moonraker
## Start Moonraker
USER moonraker
EXPOSE 7125