MedCATtrainer
MedCATtrainer copied to clipboard
Optimised multi-stage docker build for `cogstacksystems/medcat-trainer`
This is an optimised multi-stage docker build for cogstacksystems/medcat-trainer
as described in detail in comments in response to #92.
-
Reduce uncompressed docker image size of
cogstacksystems/medcat-trainer:v2.6.0
from 7.71GB to 6.13GB- Separate stage for building frontend saves ~450MB by only using the
dist
folder that is the output ofnpm build
- Disable pip cache with
pip install --no-cache-dir
to save >900MB - Copy only required folders/files to save ~20MB
- Separate stage for building frontend saves ~450MB by only using the
- Create a non-root user to install dependencies and run container without elevated permissions
- Fix path to manage.py in run.sh
Tested and working with docker-compose.yml with cogstacksystems/medcat-trainer-nginx:v2.6.0
and solr:8
(with default cdb.dat
and vocab.dat
).
hi @vvcb - thanks for the contribution here. I tried building and running locally:
$ docker compose -f docker-compose-dev.yml up
when I navigate to http://localhost:8001/ - the UI doesn't come up, /admin/ does appear though.
Also on the api container - can we still have vim installed?
I've found it handy in a pinch