busy-beaver
busy-beaver copied to clipboard
Pre-compile code to improve container startup time
Great tips in the talk: Itamar Turner-Trauring - Best practices for production-ready Docker packaging
We should start pre-compiling code to improve startup time
# Compile installed code:
RUN python -c "import compileall; \
compileall.compile_path(maxlevels=10)"
# Compile code in a directory:
RUN python -m compileall yourpackage/
Additional information
- https://pythonspeed.com/docker/