chore(ops): move instance state to /var/lib/homarr without touching the image
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5867b14836
commit
83d9db6447
3 files changed
+119
-20
No files matched your search
+4
-20
@@ -40,26 +40,10 @@ case "$DB_URL" in
|
||||
[mM][yY][sS][qQ][lL]:*|[mM][aA][rR][iI][aA][dD][bB]:*) reject_mysql ;;
|
||||
esac
|
||||
|
||||
# Create the directories this instance will actually write to.
|
||||
#
|
||||
# Derived from the configuration rather than hard-coded, so an installation that
|
||||
# stores its state elsewhere — a bare-metal one under /var/lib, say — does not
|
||||
# get an empty /appdata recreated behind its back at every start. The defaults
|
||||
# reproduce the image's layout exactly: the Dockerfile sets DB_URL to
|
||||
# /appdata/db/db.sqlite and DB_DIALECT to sqlite, and REDIS_IS_EXTERNAL to false.
|
||||
mkdir -p "${LOCAL_CERTIFICATE_PATH:-/appdata/trusted-certificates}"
|
||||
|
||||
# Only for SQLite: on any other engine DB_URL is a connection string, and its
|
||||
# dirname would be a meaningless path.
|
||||
if [ "${DB_DIALECT:-sqlite}" = "sqlite" ]; then
|
||||
mkdir -p "$(dirname "${DB_URL:-/appdata/db/db.sqlite}")"
|
||||
fi
|
||||
|
||||
# The bundled Redis reads its directory from redis.conf; creating it when an
|
||||
# external server is used would leave an empty directory nobody writes to.
|
||||
if [ "$REDIS_IS_EXTERNAL" != "true" ]; then
|
||||
mkdir -p /appdata/redis
|
||||
fi
|
||||
# Create sub directories in volume
|
||||
mkdir -p /appdata/db
|
||||
mkdir -p /appdata/redis
|
||||
mkdir -p /appdata/trusted-certificates
|
||||
|
||||
# Run migrations
|
||||
if [ "$DB_MIGRATIONS_DISABLED" = "true" ]; then
|
||||
|
||||
Reference in new issue
Block a user