TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Docker and Python

12 点作者 jajjarax超过 4 年前

4 条评论

jamemuraca超过 4 年前
Nice one! Consider a follow up article with 1. Alpine Linux as the base image to significantly reduce the size and 2. Build the requirements in one layer, and then transfer the codebase to a new layer to further reduce size.
66antigravity超过 4 年前
First of all, I would rather use docker-compose, not a single docker build, since your app can grow. Speaking of growing, I would separate dev &amp; prod docker-compose.<p>&gt; When we develop more than one python project, we need to configure our development environment with the dependencies of all the projects.<p>use pyenv and simple virtualenvs.<p>I think you are trying to substitute a virtualenvs with a docker. Why trying to kill a sparrow with a cannon?
rwdim超过 4 年前
while i agree this is overly complex given the simplicity of virtualenvs, there is something “pythonic” about encapsulating the environment in a container.<p>I would suggest using alpine containers with python for a ~40mB container, versus the ~900MB container created here to run a server.<p>For me, python containers are only used when I want to bundle things into services on swarm, and I use venvs for local development.
MeteorMarc超过 4 年前
How is this easier than sharing a requirements.txt and a requirements-dev.txt on git and having a venv per python project?
评论 #25558148 未加载