Considering your problem, as I know it the easiest way is to update to the latest version of pipenv. It is still in development, so problems are fixed very soon.
We are using pipenv with docker in production. And we really like it.
There are several things to keep in mind:
- You need to use
--systemflag, so it will install all packages into the system python, and not into thevirtualenv. Sincedockercontainers do not need to havevirtualenvs - You need to use
--deployflag, so your build will fail if yourPipfile.lockis out of date - You need to use
--ignore-pipfile, so it won’t mess with our setup
Check the official docs to be sure that this information is up-to-date.
All in all:
pipenv install --system --deploy --ignore-pipfile
There’s also one more thing. If you are using the same Dockerfile for both development and production it would be very nice to also use --dev flag for the development environment only.
Also, check out our django project template to see the full example: wemake-django-template