basic structure setup

This commit is contained in:
Niklas Mueller 2024-06-15 17:01:42 +02:00
parent 0ba46dad75
commit 95f8488227
9 changed files with 200 additions and 2 deletions

View file

@ -0,0 +1,15 @@
FROM python:3.10-slim
WORKDIR /app
COPY ./requirements.txt /app
RUN apt-get update && apt-get install -y build-essential
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
EXPOSE 8000
COPY . /app
CMD ["python", "src/app.py"]

View file

@ -0,0 +1,11 @@
uvicorn==0.22.0
fastapi==0.109.1
minio==7.1.17
opensearch-py==2.3.2
opensearch-logger==1.3.0
python-dotenv==1.0.0
python-multipart==0.0.7
PyPDF2==3.0.1

View file

View file

@ -0,0 +1,30 @@
"""FastAPI Backend"""
import uvicorn
import os
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from dotenv import load_dotenv
from core.config import settings
load_dotenv()
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
print('OPENSEARCH_USE_SSL')
print(os.getenv('OPENSEARCH_USE_SSL'))
print('settings.API_V1_STR')
print(settings.API_V1_STR)
if __name__ == "__main__":
uvicorn.run("app:app", host="0.0.0.0", port=8000, reload=True)

View file

@ -0,0 +1,7 @@
# config.py
class Settings:
API_V1_STR: str = "/api"
settings = Settings()