Skip to content

Commit 6617ad6

Browse files
committed
Init
0 parents  commit 6617ad6

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM python:3-slim
2+
ENV TZ=America/Los_Angeles
3+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
4+
WORKDIR /app
5+
COPY ./ .
6+
RUN pip install -r requirements.txt
7+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "4000"]

main.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from fastapi import FastAPI
2+
3+
4+
app = FastAPI()
5+
6+
7+
@app.get('/')
8+
async def hello_world():
9+
return 'hello world'

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fastapi
2+
uvicorn[standard]

0 commit comments

Comments
 (0)