From 6ddd2f22e372fad762c92a15b27bc7ecf2edc4a0 Mon Sep 17 00:00:00 2001 From: Gary Kwok Date: Wed, 24 Jan 2024 17:21:54 +0800 Subject: [PATCH] V1 --- Dockerfile | 7 +++++++ app/main.py | 9 +++++++++ requirements.txt | 32 ++++++++++++++++++++++++++++++++ venv/Readme | 0 4 files changed, 48 insertions(+) create mode 100644 Dockerfile create mode 100644 app/main.py create mode 100644 requirements.txt create mode 100644 venv/Readme diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ddbe389 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM python:3.10 + +WORKDIR /code +COPY ./requirements.txt /code/requirements.txt +RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt +COPY ./app /code/app +CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080"] \ No newline at end of file diff --git a/app/main.py b/app/main.py new file mode 100644 index 0000000..f2e88b9 --- /dev/null +++ b/app/main.py @@ -0,0 +1,9 @@ +from typing import Union + +from fastapi import FastAPI + +app = FastAPI() + +@app.get("/") +def read_root(): + return {"Hello": "World"} \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..d89e9d6 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,32 @@ +annotated-types==0.6.0 +anyio==4.2.0 +certifi==2023.11.17 +click==8.1.7 +dnspython==2.4.2 +email-validator==2.1.0.post1 +exceptiongroup==1.2.0 +fastapi==0.109.0 +h11==0.14.0 +httpcore==1.0.2 +httptools==0.6.1 +httpx==0.26.0 +idna==3.6 +itsdangerous==2.1.2 +Jinja2==3.1.3 +MarkupSafe==2.1.3 +orjson==3.9.10 +pydantic==2.5.3 +pydantic-extra-types==2.4.1 +pydantic-settings==2.1.0 +pydantic_core==2.14.6 +python-dotenv==1.0.0 +python-multipart==0.0.6 +PyYAML==6.0.1 +sniffio==1.3.0 +starlette==0.35.1 +typing_extensions==4.9.0 +ujson==5.9.0 +uvicorn==0.25.0 +uvloop==0.19.0 +watchfiles==0.21.0 +websockets==12.0 diff --git a/venv/Readme b/venv/Readme new file mode 100644 index 0000000..e69de29