Issue deploying Django Digital Membership Card app on Fly.io

Hi everyone,

I’m trying to deploy a Python/Django application on Fly.io, but I’m facing issues during the deployment process. The application is containerized using Docker and deployed using the fly deploy command. This project is a Digital Membership Card software system that includes features like user authentication, member data management, and backend APIs for validating and issuing membership access.

The main problem is that the deployment fails during the Docker build stage. In some cases, the build process does not complete successfully, and in other attempts it gets stuck while creating the machine. Because of this, the application never reaches a running state on Fly.io.

I have already verified my Dockerfile and ensured it is properly configured for a Django application. The requirements.txt file contains all necessary dependencies, and the fly.toml configuration also seems correct. The application runs fine locally using Docker, so the issue appears to be specific to the Fly.io deployment environment. I have also tried redeploying multiple times using fly deploy, but the problem still persists.

I would like to understand what could be causing this Docker build failure on Fly.io. Are there any known limitations or common issues when deploying Django applications with Docker on Fly.io? Any guidance or best practices would be really helpful.

If needed, I can share my Dockerfile, fly.toml, or build logs for further debugging.

Hey, happy to help with your issue but it’s hard to say without seeing the actual error, could you paste the build logs and Dockerfile?

Hi, Django apps build and deploy just fine on Fly. Can you share more details? your Dockerfile would be interesting, but also the full output of fly deploy (which will show build progress etc).
You can also try a local Docker build to rule out issues with the build itself, not the Fly builders: docker build --tag foo . ought to do it.

We can probably tell you more based on this information but one thing you can shot-in-the-dark try is moving your Fly builder to a different region, do this in Sign in to Your Account · Fly settings → app builders. I’m fairly certain this won’t help but it’s something you could try quickly.