busy-beaver-dev / busy-beaver

The Chicago Python Community Engagement Slack bot
https://busybeaverbot.com
MIT License
70 stars 23 forks source link

Pre-compile code to improve container startup time #334

Open alysivji opened 4 years ago

alysivji commented 4 years ago

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