Add config.overrides.py for development config

This commit is contained in:
Paul Bienkowski 2022-02-18 18:33:45 +01:00
parent 71a04b1611
commit 01bde30d0c
3 changed files with 8 additions and 0 deletions

2
api/.gitignore vendored
View file

@ -43,3 +43,5 @@ local/
# both, because then developers will only update one of them and they'll
# contradict. For now, npm shall be the canonical default (compare README.md).
yarn.lock
config.overrides.py

View file

@ -31,6 +31,10 @@ app = Sanic("OpenBikeSensor Portal API", load_env="OBS_", log_config={})
if isfile("./config.py"):
app.update_config("./config.py")
# For developers to override the config without committing it
if isfile("./config.overrides.py"):
app.update_config("./config.overrides.py")
c = app.config
api = Blueprint("api", url_prefix="/api")

View file

@ -28,6 +28,7 @@ services:
- ./api/scripts/obs:/opt/obs/scripts/obs
- ./api/tools:/opt/obs/api/tools
- ./api/config.dev.py:/opt/obs/api/config.py
- ./api/config.overrides.py:/opt/obs/api/config.overrides.py
- ./frontend/build:/opt/obs/frontend/build
- ./tile-generator:/opt/obs/tile-generator
- ./local/api-data:/data
@ -51,6 +52,7 @@ services:
- ./api/scripts/obs:/opt/obs/scripts/obs
- ./api/tools:/opt/obs/api/tools
- ./api/config.dev.py:/opt/obs/api/config.py
- ./api/config.overrides.py:/opt/obs/api/config.overrides.py
- ./local/api-data:/data
depends_on:
- postgres