Spoolman icon indicating copy to clipboard operation
Spoolman copied to clipboard

Reduce Docker container size

Open Shadowsith opened this issue 6 months ago • 0 comments

These changes optimize the size of the docker container based on #745

Before with python:3.12-bookwom: ~1.09 GB

After the changes: ~276 MB

How I've tested it:

  1. Installed client npm dependencies and built client in project with production api environment
  2. Created a docker-compose.yml in project root folder to build/test the local spoolman image
  3. Tested Dockerfile changes via docker-compose build
  4. Started container via docker-compose up -d and made some user tests within the web client

My local docker-compose.yml as reference

version: '3.8'
services:
  spoolman:
    image: spoolman
    container_name: spoolman
    restart: unless-stopped
    volumes:
      # Mount the host machine's ./data directory into the container's /home/app/.local/share/spoolman directory
      - ./data:/home/app/.local/share/spoolman
    ports:
      # Map the host machine's port 7912 to the container's port 8000
      - "7912:8000"
    environment:
      - TZ=Europe/Stockholm # Optional, defaults to UTC
    build:
      context: .
      target: python-runner
``

Shadowsith avatar Aug 20 '25 23:08 Shadowsith