Add support for serving static files from DATA_FILES_DIR
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:
@@ -26,6 +26,7 @@ services:
|
||||
- ./backend:/app
|
||||
- ./uploads:/app/uploads
|
||||
- backend_dev_modules:/app/.venv
|
||||
- ${HOST_DATA_FILES_DIR}:${DATA_FILES_DIR}
|
||||
ports:
|
||||
- "8000:8000"
|
||||
env_file:
|
||||
@@ -34,6 +35,8 @@ services:
|
||||
- DATABASE_URL=${DATABASE_URL}
|
||||
- SECRET_KEY=${SECRET_KEY}
|
||||
- ENVIRONMENT=development
|
||||
- DATA_FILES_DIR=${DATA_FILES_DIR}
|
||||
- HOST_DATA_FILES_DIR=${HOST_DATA_FILES_DIR}
|
||||
- DEBUG=true
|
||||
- BACKEND_CORS_ORIGINS=${BACKEND_CORS_ORIGINS}
|
||||
depends_on:
|
||||
|
||||
Reference in New Issue
Block a user