You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make SQLite temp files work on a read-only root #1972
SQLite writes temp files (sorts, temp B-trees, large transactions) to a directory that the unix VFS chooses: SQLITE_TMPDIR, then TMPDIR, then /var/tmp, /usr/tmp, /tmp and .. It reads the two environment variables once, at OS init. On a container with a read-only root filesystem, none of the default directories may be writable, so a large import can fail.
Make the temp directory a deployment setting, not code in gtfsdb. For example, set TMPDIR (or SQLITE_TMPDIR) to a writable volume in the Dockerfile and the docker-compose files, and document it in the README. Setting the variable from createDB is not reliable, because SQLite reads it only once per process.
Found in review of #1677, which keeps the default file-backed temp storage (temp_store is not changed).
I noticed this is self-assigned—are you currently working on this, or would you like me to open a PR?
I have the proposed changes drafted:
Dockerfile & Dockerfile.dev: Ensure /app/data/tmp exists with proper ownership (chown -R maglev:maglev), and set ENV TMPDIR=/app/data/tmp so SQLite directs temp spill files to the writable volume instead of the read-only root /tmp.
Docker Compose: Add TMPDIR: /app/data/tmp to the environment: section in both docker-compose.yml and docker-compose.dev.yml.
Documentation: Update README.markdown to document deployment guidance for read-only root container environments.
Happy to open a PR with these updates if you'd like!
Activity
Ashu-300 commentedon Nov 9, 2026
Hi @aaronbrethorst ,
I noticed this is self-assigned—are you currently working on this, or would you like me to open a PR?
I have the proposed changes drafted:
Dockerfile & Dockerfile.dev: Ensure /app/data/tmp exists with proper ownership (chown -R maglev:maglev), and set ENV TMPDIR=/app/data/tmp so SQLite directs temp spill files to the writable volume instead of the read-only root /tmp.
Docker Compose: Add TMPDIR: /app/data/tmp to the environment: section in both docker-compose.yml and docker-compose.dev.yml.
Documentation: Update README.markdown to document deployment guidance for read-only root container environments.
Happy to open a PR with these updates if you'd like!