modified dependencies
This commit is contained in:
parent
9b2151f7a9
commit
2adca0d132
1
.dockerignore
Normal file
1
.dockerignore
Normal file
@ -0,0 +1 @@
|
|||||||
|
app/__pycache__
|
||||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
app/__pycache__
|
||||||
@ -13,10 +13,10 @@ COPY requirements.txt .
|
|||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
# Copy project files
|
# Copy project files
|
||||||
COPY /app ./app
|
COPY /app .
|
||||||
|
|
||||||
# Expose port
|
# Expose port
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
# Run the app with Uvicorn
|
# Run the app with Uvicorn
|
||||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||||
|
|||||||
Binary file not shown.
@ -4,13 +4,12 @@ from fastapi.templating import Jinja2Templates
|
|||||||
from fastapi.staticfiles import StaticFiles
|
from fastapi.staticfiles import StaticFiles
|
||||||
from fastapi.concurrency import run_in_threadpool
|
from fastapi.concurrency import run_in_threadpool
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import app.download as download
|
import json, download
|
||||||
import json
|
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
|
|
||||||
app.mount("/static", StaticFiles(directory="/app/app/static"), name="static")
|
# app.mount("/static", StaticFiles(directory="/app/app/static"), name="static")
|
||||||
templates = Jinja2Templates(directory="/app/app/templates")
|
templates = Jinja2Templates(directory="templates")
|
||||||
|
|
||||||
|
|
||||||
# api
|
# api
|
||||||
@ -24,7 +23,7 @@ async def dropoutUpdate():
|
|||||||
|
|
||||||
@app.get("/dropoutSeries", response_class=JSONResponse)
|
@app.get("/dropoutSeries", response_class=JSONResponse)
|
||||||
async def dropoutSeries():
|
async def dropoutSeries():
|
||||||
file_path = Path("/data/dropout.json")
|
file_path = Path("data/dropout.json")
|
||||||
if file_path.exists():
|
if file_path.exists():
|
||||||
with file_path.open("r", encoding="utf-8") as f:
|
with file_path.open("r", encoding="utf-8") as f:
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user