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,8 @@ services:
|
||||
environment:
|
||||
- DATABASE_URL=${DATABASE_URL}
|
||||
- SECRET_KEY=${SECRET_KEY}
|
||||
- DATA_FILES_DIR=${DATA_FILES_DIR}
|
||||
- HOST_DATA_FILES_DIR=${HOST_DATA_FILES_DIR}
|
||||
- ENVIRONMENT=production
|
||||
- DEBUG=false
|
||||
- BACKEND_CORS_ORIGINS=${BACKEND_CORS_ORIGINS}
|
||||
@@ -35,6 +37,8 @@ services:
|
||||
networks:
|
||||
- app-network
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ${HOST_DATA_FILES_DIR}:${DATA_FILES_DIR}
|
||||
|
||||
frontend:
|
||||
build:
|
||||
|
||||
Reference in New Issue
Block a user