Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
# Setup Virtual Environment ```python conda create -n fastapi-env python=3.12.4 conda activate fastapi-env pip install -r requirements.txt ``` # Running the server `uvicorn main:app --reload` # `uvicorn main:my_first_api --reload` The command `uvicorn main:app` refers to: - main: the file main.py (the Python "module"). - app: the object created inside of main.py with the line app = FastAPI(). - --reload: make the server restart after code changes. Only use for development. ``` sudo yum update -y sudo amazon-linux-extras install docker sudo service docker start sudo systemctl start docker sudo service docker status sudo groupadd docker sudo usermod -a -G docker ec2-user newgrp docker docker —-version # create ECR with name: my-flask-app aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 866824485776.dkr.ecr.us-east-1.amazonaws.com