Slimcat: shrink size of 4cat image #500
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Create working 4cat:slim image
Deploy via
docker compose -f docker-compose_build.yml up -d --buildCurrently the 4cat:stable image is 4.73 GB on the drive. The image from
Docker_slimreduces that to 2.06 GB.Breakdown:
python:3.11-slim): 195MB/opt/venv/): 1.1 GB/usr/lib/x86_64-linux-gnu: 85MB which could perhaps be reducedI already removed ffmpeg (it was ~400 MB). Additional reductions seem unlikely without reviewing python packages.
Issues
There are some consequences here. Mainly that we lose the ability to upgrade python environments. With Docker, that is not so bad a deal as you can download a previously created image with the appropriate environment.
Some maintenance will need to be done to test and ensure this image works with all environment changes. Processors using certain features (e.g., ffmpeg) need to be disabled.
Known To-do:
migrate.pywill not work in its current form; it would need to be modified or circumvented. Ideally modified so that the environment and code base could be maintained/updated via Docker, but any necessary migrate scripts (for such things as database changes) could still be run.Question
Is the reduction of 2.6 gigs worth it? Is container size the real user bottleneck?