Check out the tutorial.
-
Fork/Clone
-
Create and activate a virtual environment:
$ python3 -m venv venv && source venv/bin/activate
-
Install the requirements:
(venv)$ pip install -r requirements.txt
-
Spin-up a PostgreSQL container:
(venv)$ docker run --name fastapi-songs-postgres -p 5432:5432 \ -e POSTGRES_USER=fastapi-songs -e POSTGRES_PASSWORD=complexpassword123 \ -e POSTGRES_DB=fastapi-songs -d postgres
-
Initialize the database:
(venv)$ python init_db.py
-
Run the server:
(venv)$ uvicorn main:app --reload
-
Navigate to http://localhost:8000/ in your favorite web browser.
-
Initialize Elastic Beanstalk:
$ eb init
-
Create an Elastic Beanstalk environment:
$ eb create fastapi-songs-env
-
Configure AWS RDS and Certificate Manager
-
Commit all the changed files to git and deploy:
$ git add . $ git commit -m "updates for eb" $ eb deploy
-
Open the web application in your favorite web browser:
$ eb open