busy-beaver icon indicating copy to clipboard operation
busy-beaver copied to clipboard

Pre-compile code to improve container startup time

Open alysivji opened this issue 4 years ago • 0 comments

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/

alysivji avatar Oct 02 '20 18:10 alysivji