Titanic survival model API. Written in FastAPI. Deployed on Heroku.
- Intall requirements from
requirements-dev.txt
.
The only difference between
requirements-dev.txt
andrequirements.txt
is that inrequirements-dev.txt
there are two extra dependencies:notebook
, andstreamlit
.
Prerequisite for the following steps is to have Docker Desktop installed on our system.
- In project root directory, build the docker image
docker build -t ds-academy-api-titanic:latest .
- Run the docker container with web server running inside:
docker run -i -e "PORT=8000" -p 8000:8000 ds-academy-api-titanic:latest
- In logs, you should see a local URL address with running API.
The repository is ready to be deployed to Heroku without any extra hassle. For deployment, follow these steps.
- Review the
heroku.yml
file to see configuration for Heroku. - Create your user profile on Heroku.
- Install Heroku CLI and
log in to your Heroku account:
heroku login
. - Create the app on Heroku.
- Set stack for the project to container:
heroku stack:set container -a=<name of the app>
. - Integrate the app with GitHub for auto-deployments.