working distribution

This commit is contained in:
Siwat Sirichai 2024-02-13 23:30:12 +07:00
parent 7097c839f3
commit 2e719f402d
3 changed files with 23 additions and 6 deletions

9
compose.yaml Normal file
View File

@ -0,0 +1,9 @@
version: '3'
services:
printer1:
build: ./printer-daemon
ports:
- "7125:7125"
- "7130:7130"
volumes:
- /var/printfarm/printer1:/opt/printstack/data

View File

@ -4,9 +4,15 @@ ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Bangkok ENV TZ=Asia/Bangkok
# User Creation # User Creation
RUN useradd -ms /bin/bash octoprint && adduser octoprint dialout RUN useradd -ms /bin/bash klippy
RUN useradd -ms /bin/bash klippy && adduser klippy dialout RUN usermod -aG dialout klippy
RUN chown printeruser:printeruser /opt/printstack RUN useradd -ms /bin/bash printeruser
RUN usermod -aG dialout printeruser
RUN addgroup --system printfarm
RUN usermod -aG printfarm klippy
RUN usermod -aG printfarm printeruser
RUN mkdir /opt/printstack
RUN chown printeruser:printfarm /opt/printstack
USER root USER root
# APT Dependencies # APT Dependencies
@ -38,9 +44,10 @@ RUN rm -f /bin/systemctl
RUN ln -s /bin/true /bin/systemctl RUN ln -s /bin/true /bin/systemctl
USER printeruser USER printeruser
WORKDIR /opt/printstack WORKDIR /opt/printstack
RUN mkdir /opt/printstack/data/klipper RUN mkdir -p /opt/printstack/data/klipper
RUN git clone https://github.com/KevinOConnor/klipper RUN git clone https://github.com/KevinOConnor/klipper
RUN ./klipper/scripts/install-ubuntu-18.04.sh RUN chmod +x ./klipper/scripts/install-ubuntu-22.04.sh
RUN ./klipper/scripts/install-ubuntu-22.04.sh
USER root USER root
RUN rm -f /bin/systemctl RUN rm -f /bin/systemctl
@ -55,4 +62,4 @@ RUN git clone https://github.com/Arksine/moonraker.git
RUN mkdir -p /opt/printstack/data/moonraker RUN mkdir -p /opt/printstack/data/moonraker
RUN moonraker/scripts/install-moonraker.sh -d /opt/printstack/data/moonraker -z RUN moonraker/scripts/install-moonraker.sh -d /opt/printstack/data/moonraker -z
########################## ##########################

View File

@ -0,0 +1 @@
printeruser ALL=(ALL:ALL) NOPASSWD: ALL