This repository contains a basic Python project of an API developed with the fastapi framework.
List of required commands
- Create a new Python virtual environment
virtualenv -p python3.9 venv
- Activate the virtual environment
source venv/bin/activate
- Install requirements with PIP
pip install -r requirements.txt
- Run the application
uvicorn app.main:app --host 0.0.0.0 --reload
List of required commands
- Installing with Poetry
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
- Activate the virtual environment
poetry shell
- install the requirements
poetry install
List of required commands
- Building the Docker image
sudo docker build --tag fastapi/dev --file docker/Dockerfile .
- Starting the Docker container
sudo docker run --name my_fastapi -d -p 80:80 fastapi/dev