fix(homarr): use named volume for /appdata and hex encryption key

- Replace the relative bind mount `../homarr/appdata:/appdata` with a
  named volume `homarr_appdata:/appdata` so the data survives cleanups
  and can be backed up through Dokploy volume backups.
- Generate SECRET_ENCRYPTION_KEY with `${hash:64}` instead of
  `${password:64}`: homarr requires a 64-character hex string
  (`openssl rand -hex 32`) and the password helper emits non-hex
  characters (g-z).

Closes #738

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Mauricio Siu
2026-07-14 10:58:33 -06:00
parent 17efd705a4
commit c6a0b1b1b5
2 changed files with 5 additions and 2 deletions

View File

@@ -4,8 +4,11 @@ services:
restart: unless-stopped
volumes:
# - /var/run/docker.sock:/var/run/docker.sock # Optional, only if you want docker integration
- ../homarr/appdata:/appdata
- homarr_appdata:/appdata
environment:
- SECRET_ENCRYPTION_KEY=${SECRET_ENCRYPTION_KEY}
ports:
- 7575
volumes:
homarr_appdata:

View File

@@ -1,6 +1,6 @@
[variables]
main_domain = "${domain}"
secret_key = "${password:64}"
secret_key = "${hash:64}"
[config]
env = ["SECRET_ENCRYPTION_KEY=${secret_key}"]