0

I'm currently learning about Docker. I'm trying to use it in my python project (I'm using Django)

In my Dockerfile, I want my image to install the dependencies of my project into each new container. I just created a requirements.txt file using the command tool 'pipreqs'

After looking at the content of this file, I realize that I have 2 others files related to the dependencies:

  • Pipfile
  • Pipfile.lock

I think they have been created and updated when I was using pipenv command.

My question is : Which one of these file should I use in my Dockerfile? Pipfile, Pipfile.lock or requirements.txt?

Jeremy
  • 225
  • 1
  • 3
  • 10

1 Answers1

0

Default choice is requirements.txt with pinned versions.

Versions can be pinned by pip freeze > requirements.txt or pipenv lock -r > requirements.txt. You need Pipfile and Pipfile.lock if you going to use pipenv inside container. Then pipenv install will use your Pipfile.lock.

andrey.s
  • 121
  • 5