Donkie / Spoolman

Keep track of your inventory of 3D-printer filament spools.
MIT License
1.03k stars 93 forks source link

How to install docker and test it #12

Closed locki-cz closed 1 year ago

locki-cz commented 1 year ago

Hi please add some basic info how to run it to others on RPI:

How to install docker:

To install the latest stable versions of Docker CLI, Docker Engine, and their dependencies:

  1. make folder spoolman:

mkdir spoolman cd spoolman

  1. download the script $ curl -fsSL https://get.docker.com -o install-docker.sh

  2. verify the script's content $ cat install-docker.sh

  3. run the script with --dry-run to verify the steps it executes $ sh install-docker.sh --dry-run

    1. run the script either as root, or using sudo to perform the installation.

$ sudo sh install-docker.sh

Set proper rights to run docker:

sudo usermod -aG docker pi

Then logout and login again to refresh your pi user rights.

Then i created folder in my home/pi/spoolman created file: docker-compose.yml

nano docker-compose.yml paste this:

version: '3.8'
services:
  spoolman:
    image: ghcr.io/donkie/spoolman:latest
    restart: unless-stopped
    volumes:
      - ./data:/home/app/.local/share/spoolman
    ports:
      - "7912:8000"

Create folder data: mkdir data

Set rights to data folder chown 1000:1000 data

then just run: docker compose up -d

check docker containers: docker ps -a

more info how to stop docker remove it etc i found there:

https://docs.docker.com/engine/reference/run/

Configuration on printer side:

https://moonraker.readthedocs.io/en/latest/configuration/#spoolman

# moonraker.conf

[spoolman]
server: http://192.168.0.123:7912
#   URL to the Spoolman instance. This parameter must be provided.
sync_rate: 5
#   The interval, in seconds, between sync requests with the
#   Spoolman server.  The default is 5.
# printer.cfg

[gcode_macro SET_ACTIVE_SPOOL]
gcode:
  {% if params.ID %}
    {% set id = params.ID|int %}
    {action_call_remote_method(
       "spoolman_set_active_spool",
       spool_id=id
    )}
  {% else %}
    {action_respond_info("Parameter 'ID' is required")}
  {% endif %}

[gcode_macro CLEAR_ACTIVE_SPOOL]
gcode:
  {action_call_remote_method(
    "spoolman_set_active_spool",
    spool_id=None
  )}

update in my case is only run in my folder spoolman:

cd spoolman

docker compose pull && docker compose up -d

Donkie commented 1 year ago

There are thousands of guides on the internet on how to install Docker, so I'm not going to cover that in the README. I can however just add a short notice on that docker is needed to run it.

locki-cz commented 1 year ago

I think that this very basic information on how to get it up and running should not be missing, it can be helpful for a lot of novice users. There are many users who are more printers and not server admins. It wasn't easy for me either.

Donkie commented 1 year ago

I have now updated the README with some basic information and guides on how to install docker and configure Moonraker. I think that should be sufficient.

Marshalldog commented 1 year ago

dumb question but can the docker install be on the raspberry pi running klipper for the printer?