Skip to content

Commit 4e1df23

Browse files
committed
Added app.yaml
1 parent 972a914 commit 4e1df23

File tree

4 files changed

+33
-2
lines changed

4 files changed

+33
-2
lines changed

.gcloudignore

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This file specifies files that are *not* uploaded to Google Cloud
2+
# using gcloud. It follows the same syntax as .gitignore, with the addition of
3+
# "#!include" directives (which insert the entries of the given .gitignore-style
4+
# file at that point).
5+
#
6+
# For more information, run:
7+
# $ gcloud topic gcloudignore
8+
#
9+
.gcloudignore
10+
# If you would like to upload your .git directory, .gitignore file or files
11+
# from your .gitignore file, remove the corresponding line
12+
# below:
13+
.git
14+
.gitignore
15+
16+
# Python pycache:
17+
__pycache__/
18+
# Ignored by the build system
19+
/setup.cfg

app.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
runtime: python39
2+
entrypoint: gunicorn -b :8080 main:app
3+
4+
env_variables:
5+
DB_URL: "postgresql://postgres:[email protected]:5432/postgres"
6+
SECRET: "3f4e1462c7bda198adf757f33f354e45672333c29613c645"
7+
8+
handlers:
9+
- url: /.*
10+
script: auto

main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
app = FastAPI()
77

8-
98
origins = ["*"]
109

1110
app.add_middleware(
@@ -16,6 +15,7 @@
1615
allow_headers=["*"],
1716
)
1817

18+
1919
@app.get("/")
2020
async def root():
2121
return {"message": "Hello World"}

requirements.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
python-dotenv
22
fastapi
3+
uvicorn
4+
gunicorn
35
fastapi-login
46
sqlalchemy
57
psycopg2-binary
6-
python-multipart
8+
python-multipart

0 commit comments

Comments
 (0)