Cannot propagate alembic revision from container to file tree with docker watch #1370
Replies: 3 comments 8 replies
-
|
I am facing the same issue. As suggested by Docker documentation, sync only works one way: from host to container. With the current watch setup and not mounting the directory as a volume, generated alembic revision files are not synced back to the host. I tried adding back the volume mapping but it resulted in the following error: |
Beta Was this translation helpful? Give feedback.
-
|
As @yohaoquan mentioned correctly I would suggest to update the documentation where the alembic revisions are still advised to be run in the container. Actually actions should be done from now on the host. As well adding packages should be done on the host (This actually is adjusted in the docs, thx @tiangolo :)). Again run the following actions on your HOST not in the docker container.
I was in the lucky position to delete all my databases and start from scratch so I had no issues after doing it accidentally in the docker container. |
Beta Was this translation helpful? Give feedback.
-
|
For anyone still having issues. Firstly, the issue seems to arise mostly among SELinux distros. Secondly, @yohaoquan above is nearly there with his solution, however there is the "z" flag missing as shown below: I wrote a comprehensive solution here that allows you to have your alembic files in your container showing in your local files whilst not breaking your compose watch feature as in the solution by @yohaoquan |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
With the new recommended
docker compose watchcommand to start the project, any db revision files generated by alembic inside the container will not be replicated in the host system.Operating System
Linux, Windows
Operating System Details
wsl2 on w11
Python Version
3.12.6
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions