Spoolman
Spoolman copied to clipboard
Reduce Docker container size
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:
- Installed client npm dependencies and built client in project with production api environment
- Created a
docker-compose.ymlin project root folder to build/test the local spoolman image - Tested Dockerfile changes via
docker-compose build - Started container via
docker-compose up -dand 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
``