Docker and pipenv

Currently, I use pipenv to isolate my Django projects. I am considering deploying a project in Docker. What is the recommended best practice for using virtualenv/pipenv in a Docker environment? Should I continue to use pipenv in the Docker container?

I don’t know what’s generally considered “best practices”, but I can tell you that we don’t bother with virtualenv in our containers. Each Django-instance container is one instance of uwsgi running one project with all libraries installed globally for that instance.
(In fact, we have a “uwsgi” container that is the base for our Django-project instances, so every instance is built from that same base image.)

I’m with Ken here.

RUN pip install --upgrade pip && pip install -r requirements.txt

And off we go.

1 Like