diff --git a/config/moonraker.cfg b/config/moonraker.cfg index da3d035..8ad5645 100644 --- a/config/moonraker.cfg +++ b/config/moonraker.cfg @@ -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 diff --git a/docker-compose.yaml b/docker-compose.yaml index c0de8d1..f727e90 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -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 diff --git a/docker/moonraker/Dockerfile b/docker/moonraker/Dockerfile index 072ec8a..c0515f5 100644 --- a/docker/moonraker/Dockerfile +++ b/docker/moonraker/Dockerfile @@ -21,13 +21,15 @@ RUN apt update \ libopenjp2-7 \ python3-libgpiod \ curl \ - libcurl4-openssl-dev \ - libssl-dev \ + libcurl4 \ + libssl1.1 \ liblmdb0 \ - libsodium-dev \ - zlib1g-dev \ + libsodium23 \ + zlib1g \ iproute2 \ - && apt clean + systemd \ + sudo \ + && apt clean WORKDIR /opt COPY --from=build /opt/moonraker ./moonraker @@ -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