why is my application so large?

I have a Python FastAPI API using a few libraries, but flyctl deploy takes FOREVER and I think it’s related to the docker container sizes.

I didn’t setup docker, this is was all done by flyctl launch. Why do I have a docker container layer with 5+GB?

==> Pushing image to fly
The push refers to repository [registry.fly.io/]
83d85471d9f8: Pushed
a2c52f4a427c: Pushed
8812c86dc680: Pushed
79acd76200c0: Pushed
d5e2d7cff052: Pushed
6acbe3583285: Pushing 2.262GB/5.731GB
4b4bd418c8a1: Pushed
a0226c5f2097: Pushed
52efb1a98ceb: Pushed
1eb5983d7301: Pushed
39d381810cef: Pushed
115fc79fb3d1: Pushed
fd93afbbe1ce: Pushed
f92983442b23: Pushed
4d274d05ee12: Pushed
548a79621a42: Pushed

I used to have a ton of files in my working directory, but I’ve since deleted them. Do I have to wipe a cache somewhere? Thanks in advance

Assuming you are deploying via a Dockerfile, it would be helpful to share both the Dockerfile and the contents of .dockerignore.

Meanwhile, try creating a file with the following contents:

FROM ubuntu
WORKDIR /app
COPY . .

Then running:

fly console --dockerfile Dockerfile.test -C bash

And from there run:

du | sort -n

What this will do is create an ephemeral machine, upload your source, and create a shell where you can explore.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.