diff --git a/.gitpod.yml b/.gitpod.yml index 3c0c831..57df11a 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,4 +1,2 @@ tasks: - - init: pip install -r requirements.txt - - + - init: docker-compose up diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9e0c47e --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Hebert F. Barros + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index a801f33..cdb6f47 100644 --- a/README.md +++ b/README.md @@ -45,11 +45,18 @@ This example shows how to use FastApi 0.88.0 on Vercel with Serverless Functions ## How it Works -This example uses the Web Server Gateway Interface (WSGI) with Flask to enable handling requests on Vercel with Serverless Functions. +This example uses the Web Server Gateway Interface (WSGI) with FastApi to enable handling requests on Vercel with Serverless Functions. ## Running Locally +### With Docker Compose + +```bash +docker-compose up +``` + ### With Docker + ```bash # Build the Docker image docker build -t deploy-python-fastapi-in-vercel . @@ -66,6 +73,7 @@ docker run -p 8000:8000 deploy-python-fastapi-in-vercel ```bash pip install -r requirements.txt ``` + ```bash uvicorn main:app --host 0.0.0.0 --port 8000 ``` @@ -94,5 +102,5 @@ Or buy me a coffee 🙌🏾 ## 📝 License -Copyright © 2023 [Hebert F Barros](https://github.com/hebertcisco).
+Copyright © 2024 [Hebert F Barros](https://github.com/hebertcisco).
This project is [MIT](LICENSE) licensed. diff --git a/docker-compose.yml b/docker-compose.yml index e69de29..677df3b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -0,0 +1,5 @@ +services: + web: + build: . + ports: + - "8000:8000" \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 34fc9cb..1dec285 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -fastapi==0.88.0 +fastapi==0.109.1 pytest==7.1.3 pytest-asyncio==0.20.3 uvicorn==0.20.0