Repository navigation
Keep renders, the render cache and assistant pictures across rebuilds - #10
Merged
Merged
Conversation
docker-compose mounts ./data at /app/data, but the app worked its data directory out from where config.py sits, two levels up. In the image that is /app/app/config.py, so it landed on /data: outside the volume. Only the database survived a rebuild, because DATABASE_URL is set explicitly; renders, the GAM file cache and pictures attached to the assistant were lost every time. DATA_DIR=/app/data is now set in the image and in the compose file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016K8ApooCKMPBVQiLjaWjcp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
docker-compose.ymlalready mounts all of./dataat/app/data, but the app wasn't writing there.With no
DATA_DIRset,config.pyderives the data directory from its own location:Path(__file__).resolve().parents[2] / "data". That works for a local checkout (backend/app/config.py→ repo root). In the image, though, the file sits at/app/app/config.py, soparents[2]is/and everything is written to/data, outside the volume.Only the database survived a rebuild, because
DATABASE_URLis set explicitly. Everything else under the data directory was lost every time:renders/),Fix
backend/Dockerfile:ENV DATA_DIR=/app/data, so the image is correct even when run without compose.docker-compose.yml:DATA_DIR=/app/databesideDATABASE_URL, with a comment on why it is load-bearing.CLAUDE.md: the deploy note now says all ofdata/is mounted, not justdata/db/.GAM isn't affected: its compose already sets
MEDIA_DIRexplicitly.Testing
app/copied under a root directory) and printedsettings.resolved_data_dir. Without the variable it resolves to the parent of the root plus/data, which is/datain the image. WithDATA_DIR=/app/datait resolves to/app/data.docker-compose.ymlstill parses.Generated by Claude Code