This documents covers the deployment instructions to get this project up on cloud hosting.
We will see Runpod to host our FastAPI server for as low as $0.34/hr.
- Build an deployment docker image for Linux environment eg.
docker build -t "davzoku/cria-fastapi:linux" -f fastapi.Dockerfile --platform linux/amd64 .
-
Sign up / Login to Docker Hub.
-
Push the deployment image to Docker Hub.
docker push davzoku/cria-fastapi:linux
-
Sign up / Login to Runpod.
-
Create a new custom template on Pod Templates page using the config similar to the following:
- use the docker image name that you pushed to Docker Hub
- make sure you have allocated enough container disk space (> docker image size)
- make sure you expose the correct HTTP port for the API call. eg. 80.
We will use Netlify to host the Next.js frontend application for free.
-
Sign up / Login to Netlify.
-
Import an existing project from Github to Netlify
-
Follow the instructions to deploy the frontend. More detailed instructions will be provided in the future.
-
Remember to set up the environment variables as per the
.env
file.