Parameterize database path and deletion #1763
Labels
back-end
Django views, sessions, middleware, models, migrations etc.
docker
Application container, devcontainer, Compose, etc.
infrastructure
Terraform, Azure, etc.
Milestone
Background
Currently, the
bin/init.sh
script deletes and then recreates (via Django'smanage.py
helpers) the Sqlite database file every time it is called. This happens both during local development and in the Azure app service --bin/init.sh
is called during the app image's startup.The Django app settings put the Sqlite database file in the same directory as the source code within the running app (or dev) container. In the Azure app service, this is an ephemeral directory that is lost on app service restarts / redeploys, so it is "good" that the database file is recreated each app service restart.
However, our "data" is encoded in a large data migration file that can read from the environment. We want to move away from configuring the app as code, and the first step is being able to maintain our database file between app service restarts.
Acceptance Criteria
DATABASE_RESET
if set andtrue
DATABASE_DIR
; default to the current directory to maintain existing behavior if unsetReverted toDATABASE_DIR
set to/home/site/wwwroot
for Azure app service; Maintain Sqlite config database in mounted storage container #1673 (comment).
for more researchDATABASE_RESET
set totrue
for Azure app service for now to maintain existing behavior while we migrate to an Admin interfaceAdditional context
The text was updated successfully, but these errors were encountered: