You can find the step-by-step deployment guide here.
Hostman uses the following environment when building a FastAPI application:
Hostman will execute the following commands during the build:
apt-get install -y python3 python3-pip gunicorn python3-psycopg2 libpq-dev python-dev default-mysql-client python3-dev default-libmysqlclient-dev python3-mysqldb --fix-missing
pip3 install psycopg2 django
ln /usr/bin/python3 /usr/bin/python -sf
ln /usr/bin/pip3 /usr/bin/pip -sf
To install dependencies, add the following line to the build command:
pip3 install --upgrade -r requirements.txt
The default start command is:
uvicorn main:app --host 0.0.0.0
If necessary, you can specify a port, for example:
uvicorn main:app --host 0.0.0.0 --port 80
main.py.0.0.0.0 rather than 127.0.0.1; otherwise, external connections will not work.