How to deploy fastapi to google cloud run

The solution to I've found is creating a Dockerfile

FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8

ENV APP_HOME /app

WORKDIR $APP_HOME
COPY . ./

RUN pip install -r requirements.txt

CMD exec gunicorn --bind :$PORT --workers 1 --worker-class uvicorn.workers.UvicornWorker  --threads 8 main:app

Then running

gcloud builds submit --tag gcr.io/PROJECT-ID/countries_fastapi

Then after image is submitted to gcloud, running

gcloud run deploy --image gcr.io/bitnami-oyzgng8y5a/countries_fastapi --platform managed