prepare cloudron 0.2.1 data persistence
This commit is contained in:
@@ -4,12 +4,18 @@
|
|||||||
"author": "Florian Heinz",
|
"author": "Florian Heinz",
|
||||||
"description": "Private Flask app for meals, shopping and gentle food planning",
|
"description": "Private Flask app for meals, shopping and gentle food planning",
|
||||||
"tagline": "einfach essen planen",
|
"tagline": "einfach essen planen",
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"upstreamVersion": "0.2.0",
|
"upstreamVersion": "0.2.0",
|
||||||
"healthCheckPath": "/",
|
"healthCheckPath": "/",
|
||||||
"httpPort": 8000,
|
"httpPort": 8000,
|
||||||
"manifestVersion": 2,
|
"manifestVersion": 2,
|
||||||
"addons": {
|
"addons": {
|
||||||
"localstorage": {}
|
"localstorage": {
|
||||||
|
"sqlite": {
|
||||||
|
"paths": [
|
||||||
|
"/app/data/nouri.sqlite3"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,4 +41,13 @@ Beim Start führt Nouri das Schema erneut mit `CREATE ... IF NOT EXISTS` aus und
|
|||||||
|
|
||||||
## Cloudron-Hinweis
|
## Cloudron-Hinweis
|
||||||
|
|
||||||
Für Cloudron ist die App jetzt so vorbereitet, dass Datenbank und Uploads unter `/app/data` liegen können. Das Startskript setzt `NOURI_DATA_DIR=/app/data` und startet die App per `gunicorn`.
|
Für Cloudron ist die App jetzt so vorbereitet, dass Datenbank und Uploads unter `/app/data` liegen. Das Startskript setzt `NOURI_DATA_DIR=/app/data`, legt die SQLite-Datei dort an und startet die App per `gunicorn`.
|
||||||
|
|
||||||
|
Lokale Testdaten und produktive Cloudron-Daten bleiben bewusst getrennt:
|
||||||
|
|
||||||
|
- lokal nutzt Nouri ohne gesetzte Variable standardmäßig `./data`
|
||||||
|
- auf Cloudron nutzt Nouri `/app/data`
|
||||||
|
- `data/` ist in `.gitignore` und `.dockerignore` ausgeschlossen und wird weder eingecheckt noch ins Image kopiert
|
||||||
|
- `/app/data` ist auf Cloudron persistent und bleibt bei App-Updates erhalten
|
||||||
|
|
||||||
|
Wenn die App auf Cloudron bereits installiert ist, bitte **kein neues `cloudron install`** ausführen. Stattdessen die bestehende App aktualisieren, also ein neues Image bzw. Paket bauen und dann die vorhandene Installation updaten.
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
export NOURI_DATA_DIR="${NOURI_DATA_DIR:-/app/data}"
|
export NOURI_DATA_DIR="${NOURI_DATA_DIR:-/app/data}"
|
||||||
|
mkdir -p "${NOURI_DATA_DIR}"
|
||||||
|
touch "${NOURI_DATA_DIR}/nouri.sqlite3"
|
||||||
mkdir -p "${NOURI_DATA_DIR}/uploads"
|
mkdir -p "${NOURI_DATA_DIR}/uploads"
|
||||||
|
|
||||||
exec gunicorn \
|
exec gunicorn \
|
||||||
|
|||||||
Reference in New Issue
Block a user