fix: ensure data directory has correct ownership before starting container
All checks were successful
Deploy c4 / deploy (push) Successful in 41s

On a fresh VM, Docker creates the bind-mounted data/ directory as
root:root, but the container runs as games (UID 5). This causes
SQLite to fail with SQLITE_CANTOPEN. Create the directory with
correct ownership in the deploy pipeline.
This commit is contained in:
Ryan Hamamura
2026-02-13 09:03:33 -10:00
parent dfc2111be5
commit 9799387a32

View File

@@ -18,5 +18,11 @@ jobs:
mkdir -p $DEPLOY_DIR
rsync -a --delete --exclude 'data/' . $DEPLOY_DIR/
- name: Ensure data directory exists with correct ownership
run: |
mkdir -p $DEPLOY_DIR/data
# UID 5 / GID 60 = games:games in the container (debian:bookworm-slim)
sudo chown 5:60 $DEPLOY_DIR/data
- name: Rebuild and restart
run: cd $DEPLOY_DIR && docker compose up -d --build --remove-orphans