add fastapi

This commit is contained in:
agatha 2024-04-12 17:12:37 -04:00
parent 25362a5ca6
commit 4c3cb9315a
4 changed files with 30 additions and 0 deletions

10
backend/Dockerfile Normal file
View 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
View 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
View File

@ -0,0 +1,4 @@
fastapi
uvicorn[standard]
sqlalchemy
pydantic

9
backend/src/main.py Normal file
View File

@ -0,0 +1,9 @@
from fastapi import FastAPI
app = FastAPI()
@app.get('/')
async def home():
return 'homepage'