The mkdir was running before the standalone COPY, which could overwrite
/app/data contents or permissions. Move it to after all COPY statements
and use chmod 700 so only nextjs owns and can write the SQLite data dir.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>