Oddbean new post about | logout
 Deploying a FastAPI application with SQLite on Fly.io is now possible, offering a simple and convenient solution for small projects. By using SQLite, developers can easily store state in their database and analyze data locally. The process begins by creating a Fly.io project, either through the web interface or CLI tool flyctl. A Dockerfile is then required to manage the project's root folder, which can be used across different systems.

To deploy the code, run the command "flyctl launch" to create a fly.toml file, where storage and mounts sections are added to attach the volume to the application. This allows for multiple instances of the app without affecting database writeability. The final step is deploying the app with the command "fly deploy", which prints the public DNS name to the console.

Source: https://dev.to/vladkens/deploy-fastapi-application-with-sqlite-on-flyio-3da1