- Install the required dependencies:
pip install -r requirements.txt
- Run the FastAPI server using Uvicorn:
uvicorn main:app --reload
- Build the Docker image:
docker build -t fastapi_todo .
- Run the Docker container:
docker run -d --name fast_api_container -p 8080:8080 \
-e secret_key=<test_key> \
-e test_hashed_password='<demo_user_hashed_pwd>' \
fastapi_todo
Replace <test_key>
with your secret key and <demo_user_hashed_pwd>
with the hashed password for the demo user.
Note: Ensure Docker is installed on your system before running the Docker commands.