Add support for serving static files from DATA_FILES_DIR
All checks were successful
Build and Push Docker Images / changes (push) Successful in 4s
Build and Push Docker Images / build-backend (push) Successful in 53s
Build and Push Docker Images / build-frontend (push) Has been skipped

Introduce a new environment variable, `DATA_FILES_DIR`, for configuring static file storage. Updated `docker-compose` files to mount the host directory and propagate the variable. Implemented FastAPI `StaticFiles` to serve files from this directory under the `/files` route.
This commit is contained in:
2025-03-12 18:23:42 +01:00
parent 63dadb9429
commit 5ad886a53e
4 changed files with 14 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ from apscheduler.schedulers.asyncio import AsyncIOScheduler
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
from app.api.router import api_router
from app.core.config import settings
@@ -46,3 +47,4 @@ async def root():
app.include_router(api_router, prefix=settings.API_V1_STR)
app.mount("/files", StaticFiles(directory=settings.DATA_FILES_DIR), name="static")