Hacker News new | ask | show | jobs
by dastx 2341 days ago
If you think having something like pipenv or gcc in your image is a "perfect way" of doing things, you're sorely mistaken.

Neither of those are needed. Use multi stage docker files to avoid such unnecessary and potentially dangerous dependencies.

In addition, why do you need to disable byte code writing? You're unnecessarily disabling optimizations done by python.

1 comments

Multi stage builds do indeed seem much better, thanks

Regarding writing bytecode - this slows down the first load of a file, in exchange for speeding up subsequent loads of a file. It has no effect on runtime speed. Given that python code is only loaded once when a Docker image is run, it is better to disable this.