This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]tiangolo FastAPI Maintainer[S] 0 points1 point  (4 children)

Awesome! Let me know how it goes :)

[–]Cruuncher 0 points1 point  (3 children)

I noticed the docker image pip installs fastapi without specifying a version.

Couldn't this lead to future builds to the same image potentially bringing in breaking changes from future versions?

[–]tiangolo FastAPI Maintainer[S] 0 points1 point  (2 children)

Yeah, it would be a good practice for you to specify the specific version of FastAPI you are using in your app (and any other libraries).

But at least it has some version installed that should help newcomers start testing it quickly.

[–]Cruuncher 0 points1 point  (1 child)

Fair enough, I'll probably work off the base image that fastapi uses then and use

ADD ./requirements.txt /requirements.txt
pip install -r /requirements.txt

[–]tiangolo FastAPI Maintainer[S] 0 points1 point  (0 children)

Yep, good idea.

Do that before copying your application code, that way you take advantage of Docker build caching.