busy-beaver-dev/busy-beaver

Pre-compile code to improve container startup time

Opened this issue · 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