✨ Mount /backend/app/alembic/versions as a volume inside container during development#1431
✨ Mount /backend/app/alembic/versions as a volume inside container during development#1431javadzarezadeh wants to merge 7 commits intofastapi:masterfrom
/backend/app/alembic/versions as a volume inside container during development#1431Conversation
/backend/app/alembic/versions as a volume inside container during development
This comment was marked as resolved.
This comment was marked as resolved.
|
As this PR has been waiting for the original user for a while but seems to be inactive, it's now going to be closed. But if there's anyone interested, feel free to create a new PR. |
This comment was marked as resolved.
This comment was marked as resolved.
YuriiMotov
left a comment
There was a problem hiding this comment.
LGTM!
Now changes made in backend/alembic/versions are visible inside the container.
Adding app/alembic/versions to ignore paths is needed to prevent infinite loop
| target: /app | ||
| ignore: | ||
| - ./backend/.venv | ||
| - app/alembic/versions |
There was a problem hiding this comment.
./backend/.venv path was invalid - all paths in ignore are relative to path: ./backend. So, it expanded to ./backend/backend/.venv which does not exist.
I removed that invalid ./backend/.venv and added app/alembic/versions to prevent infinite loop on updating files in alembic/versions mounted volume
/backend/app/alembic/versions as a volume inside container during development/backend/app/alembic/versions as a volume inside container during development
|
This pull request has a merge conflict that needs to be resolved. |
|
Thanks for the interest! But as the user inside the container is different than the user outside, the generated files would belong to a different user ID, making them non-editable by the regular user (unless using It was like this at some point and I removed it to avoid this problem precisely. So I'll pass on this, but thanks! ☕ |
I've mapped the Docker container's Alembic folder to the local directory, ensuring that any auto-generated migration files created by Alembic are automatically copied to the local development environment.