-
-
Notifications
You must be signed in to change notification settings - Fork 614
fly.io Deployment
Rodja Trappe edited this page Sep 4, 2023
·
15 revisions
This tutorial demonstrates how to deploy a NiceGUI application on Fly.io.
Create a Python file main.py
with the following content:
from nicegui import ui
from quotes import Quotes
quotes = Quotes()
ui.button('Quote', on_click=lambda: ui.notify(quotes.random()[1]))
ui.run()
Create a Dockerfile
which describes the setup of packages you need to run your app:
FROM zauberzeug/nicegui:1.3.13
RUN pip install quotes
COPY . /app
- Install flyctl, the command line interface (CLI) to administer your fly.io deployment.
- Create an account with the terminal command
fly auth signup
or login withfly auth login
. - Run
fly launch
from inside your project source directory, it will create, configure, and deploy your new application according to the Dockerfile.