ysskrishna logoysskrishna

FastAPI UV vs Requirements File

Two Docker builds, one FastAPI app. Compare packaging paths on your machine.

Get it
Built with
Starter Kits & Boilerplates
DevOps & Infrastructure
Backend & APIs
FastAPI
uv
Docker
Python
SQLite
Details
FreeMIT licenseCreated June 8, 2025Updated November 12, 2026
Share this product

You are about to dockerize a FastAPI service. The packaging choice is still a meeting, not a decision.

Slides say one tool is faster. Your teammate still trusts the old install flow. Nobody wants to bet a production repo on a blog post they skimmed once. You want the same app built two ways, on your laptop, with something you can actually run and poke at.

This starter is that side-by-side lab: one FastAPI sample, two container images, one compose file to bring both up.

Same app. Two installs. Your numbers.

What you get

  • A real comparison setup, not a screenshot. One FastAPI backend with user-management-style routes and SQLite, packaged twice for Docker.
  • Classic install path in one image. Dependencies install the traditional way from a requirements file with pip.
  • Modern install path in the other. The second image uses uv for resolution and installs, with caching called out in the project docs.
  • Side-by-side local ports. Compose starts both services so you can hit the same API surface on each assigned port and compare behavior yourself.
  • Shared code you extend once. Change routes or models in one place, rebuild both images, and see how each container recipe responds.
  • Health checks and CORS included. Both services ship with middleware and health checks so the sample feels closer to a real service than a hello-world stub.

Your first morning after cloning

Picture copying the sample environment file, bringing compose up, and watching two builds finish. You open the requirements-style service on one port and the uv-style service on the other. Same endpoints, two dependency stories. You note which rebuild feels snappier on your machine, screenshot the diff for the team chat, and move on with evidence instead of opinions.

Ready to try it?

Frequently asked questions

Why not just copy the official uv Docker example myself?

You can. Official samples focus on the install pattern. This repo adds a full FastAPI app with user routes, SQLite, CORS, health checks, and compose wiring so both images run together without you stitching demos from three READMEs.

What is being compared?

The same FastAPI app is built as two Docker images. One installs dependencies with pip from a requirements file. The other uses uv for resolution and installs.

How do I run both side by side?

Copy the sample environment file to your own env file, then start with compose and a fresh build. The requirements-style variant listens on localhost port 8081 and the uv variant on port 8082 so you can call the same API on each.

How do I compare pip and uv dependency installs side by side?

Start both services from the one compose file. Change shared application code once, rebuild both images, and compare build behavior and workflow on your machine rather than trusting someone else's benchmark.

What else ships in the sample?

You get CORS middleware, Docker health checks for both services, and a shared layout for the app entrypoint, routers, and models that you can extend before rebuilding.

Are build-time numbers universal?

No. Build time and image size depend on your CPU, cache, and dependency set. Treat any timing you see as a local experiment. SQLite here is for demos, not a production database choice.

Is it free?

Yes. The README states the template is licensed under the MIT License, and the product listing marks the price as Free.

Continue exploring

ProductNextjs Multi-Stage Docker

Nextjs Multi-Stage Docker

See the real size gap between one-stage and multi-stage Next.js Docker builds.
DevOps & Infrastructure
Starter Kits & Boilerplates
+7
ProductFlask Nginx Docker Starter

Flask Nginx Docker Starter

Day one should not be proxy wiring. Clone a layout that already puts a front server ahead of your app.
DevOps & Infrastructure
Backend & APIs
+5
BlogCover image for OSC 7501 in Python: Tell the Terminal When Your CLI Is Working, Blocked or Done

OSC 7501 in Python: Tell the Terminal When Your CLI Is Working, Blocked or Done

Python
Python CLI
+1
3 min read
ProductFastapi Sync Async Starter Template

Fastapi Sync Async Starter Template

Start your FastAPI service with sync and async database patterns wired, tested, and ready to run in Docker.
Backend & APIs
Starter Kits & Boilerplates
+8
ProductExpress FastAPI Protobuf

Express FastAPI Protobuf

Clone a quote browser that keeps JSON at the edge and binary contracts between services.
Backend & APIs
Starter Kits & Boilerplates
+6
ProductFastAPI Clerk Starter

FastAPI Clerk Starter

A FastAPI API with Clerk JWT checks and user routes ready on day one.
Auth & Security
Backend & APIs
+8