Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa6765 committed May 25, 2024
1 parent 01f631d commit 6d43c7c
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,5 @@ __azurite_db*__.json

# Serverless directories
.serverless
node_modules
node_modules
aws_lambda_fastapi_venv
52 changes: 51 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,52 @@
# aws-lambda-serverless-fastapi
fastapi rest api aws lambda with serverless
Deploy fastapi on aws lambda with serverless

* production ready
* good project structure
* cd/cd with github action

# local development (fastapi)

## env
```bash
# create virtual environment
python3 -m venv .aws_lambda_fastapi_venv

# activate virtual environment
source .aws_lambda_fastapi_venv/bin/activate
```

## run fast api project

```bash
# install packages
pip3 install -r requirements.txt

# run project with uvicorn
uvicorn "fastapi_project.main:app" --reload --port=8000
```

# deploy on production

## github action

set secrets `SERVERLESS_ACCESS_KEY` , `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`

## serverless
* set your data

```bash
# serverless.yml
org: code4mk
app: demo-app-api-fastapi
service: demo-app-api-fastapi
```

## with cli

```bash
serverless deploy --aws-profile your_aws_profile_name
```



0 comments on commit 6d43c7c

Please sign in to comment.