This document explains how to deploy a simple FastAPI app to the cloud using fastapi-serve
.
.
โโโ main.py # The FastAPI app
โโโ README.md # This README file
โโโ requirements.txt # The requirements file for the FastAPI app
The FastAPI app to be deployed is defined in main.py
as app
.
To deploy the app locally, run:
fastapi-serve deploy local main:app
โโโโโโโโโโโโโโโโโ ๐ Flow is ready to serve! โโโโโโโโโโโโโโโโโ
โญโโโโโโโโโโโโโโ ๐ Endpoint โโโโโโโโโโโโโโโโฎ
โ โ Protocol HTTP โ
โ ๐ Local 0.0.0.0:8080 โ
โ ๐ Private 192.168.29.185:8080 โ
โ ๐ Public 49.37.163.80:8080 โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโโโโโโโโโโโ ๐ HTTP extension โโโโโโโโโโโโโฎ
โ ๐ฌ Swagger UI 0.0.0.0:8080/docs โ
โ ๐ Redoc 0.0.0.0:8080/redoc โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Note - We use Uvicorn to deploy the app locally. You can use the Uvicorn CLI for local deployment instead if you prefer.
fastapi-serve deploy jcloud main:app
Note - The
main:app
argument indicates that you want to deploy the FastAPI app namedapp
found inmain.py
.
โญโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ App ID โ fastapi-37a32285c3 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Phase โ Serving โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Endpoint โ https://fastapi-37a32285c3.wolf.jina.ai โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ App logs โ https://cloud.jina.ai/ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Base credits (per hour) โ 10.104 (Read about pricing here) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Swagger UI โ https://fastapi-37a32285c3.wolf.jina.ai/docs โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ OpenAPI JSON โ https://fastapi-37a32285c3.wolf.jina.ai/openapi.json โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
You can now access your app at the URL in the Endpoint
field and the Swagger UI at the URL in the Swagger UI
field ๐
To deploy the app with a custom name, you can use the --name
flag:
fastapi-serve deploy jcloud main:app --name myapi
โญโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ App ID โ myapi-9b12c3d030 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Phase โ Serving โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Endpoint โ https://myapi-9b12c3d030.wolf.jina.ai โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ App logs โ https://cloud.jina.ai/ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Base credits (per hour) โ 10.104 (Read about pricing here) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Swagger UI โ https://myapi-9b12c3d030.wolf.jina.ai/docs โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ OpenAPI JSON โ https://myapi-9b12c3d030.wolf.jina.ai/openapi.json โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
To list all your deployed apps, run:
fastapi-serve list
โญโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ AppID โ Phase โ Endpoint โ Created โ
โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ myapi-9b12c3d030 โ Serving โ https://myapi-9b12c3d030.wolf.jina.ai โ 13-Jul-2023 15:30 GMT +0530 โ
โ fastapi-37a32285c3 โ Serving โ https://fastapi-37a32285c3.wolf.jina.โฆ โ 13-Jul-2023 15:23 GMT +0530 โ
โฐโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
To check the status of a deployed app, run:
fastapi-serve status myapi-9b12c3d030
To remove a deployed app, run:
fastapi-serve remove myapi-9b12c3d030
With fastapi-serve
, deploying your FastAPI applications has never been easier!