add fastapi
This commit is contained in:
parent
25362a5ca6
commit
4c3cb9315a
10
backend/Dockerfile
Normal file
10
backend/Dockerfile
Normal file
@ -0,0 +1,10 @@
|
||||
FROM python:alpine
|
||||
WORKDIR /app/backend
|
||||
|
||||
COPY ./requirements.txt /app
|
||||
RUN pip install --no-cache-dir -r /app/requirements.txt
|
||||
|
||||
COPY ./src /app/backend
|
||||
|
||||
EXPOSE 8000
|
||||
CMD ["uvicorn", "main:app", "--host", "0.0.0.0"]
|
7
backend/README.md
Normal file
7
backend/README.md
Normal file
@ -0,0 +1,7 @@
|
||||
# Daily Agenda App Backend
|
||||
Written in FastAPI.
|
||||
|
||||
```shell
|
||||
docker build -t agenda-backend .
|
||||
docker run --rm agenda-backend
|
||||
```
|
4
backend/requirements.txt
Normal file
4
backend/requirements.txt
Normal file
@ -0,0 +1,4 @@
|
||||
fastapi
|
||||
uvicorn[standard]
|
||||
sqlalchemy
|
||||
pydantic
|
9
backend/src/main.py
Normal file
9
backend/src/main.py
Normal file
@ -0,0 +1,9 @@
|
||||
from fastapi import FastAPI
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
@app.get('/')
|
||||
async def home():
|
||||
return 'homepage'
|
||||
|
Loading…
Reference in New Issue
Block a user