Closed tabathadelane closed 4 years ago
I just tested this on a Linux host. The PostgreSQL database does persist, but git status
throws a warning:
$ git status
warning: could not open directory 'postgres-data/': Permission denied
On branch models
Your branch is up to date with 'origin/models'.
nothing to commit, working tree clean
What's happening is that Docker is creating a new directory postgres-data
with UID 999
and group root
.
$ ls -altr
total 80
drwxrwxr-x 22 znmeb znmeb 4096 Mar 29 17:17 ..
-rw-r--r-- 1 znmeb znmeb 1147 Mar 29 17:17 wait_for_postgres.py
-rw-r--r-- 1 znmeb znmeb 354 Mar 29 17:17 .travis.yml
-rw-r--r-- 1 znmeb znmeb 85 Mar 29 17:17 setup.cfg
-rw-r--r-- 1 znmeb znmeb 565 Mar 29 17:17 requirements.txt
-rw-r--r-- 1 znmeb znmeb 386 Mar 29 17:17 mkdocs.yml
-rwxr-xr-x 1 znmeb znmeb 971 Mar 29 17:17 manage.py
drwxr-xr-x 3 znmeb znmeb 4096 Mar 29 17:17 docs
-rw-r--r-- 1 znmeb znmeb 22 Mar 29 17:17 .dockerignore
-rw-r--r-- 1 znmeb znmeb 403 Mar 29 17:17 Dockerfile
drwxr-xr-x 2 znmeb znmeb 4096 Mar 29 17:17 dev
-rw-r--r-- 1 znmeb znmeb 196 Mar 29 17:17 .coveragerc
-rw-r--r-- 1 znmeb znmeb 1472 Mar 29 19:57 README.md
drwxr-xr-x 5 znmeb znmeb 4096 Mar 29 19:57 pandaid-rest-api
-rw-r--r-- 1 znmeb znmeb 1274 Mar 29 19:57 .gitignore
-rw-r--r-- 1 znmeb znmeb 612 Mar 29 19:57 docker-compose.yml
drwxr-xr-x 8 znmeb znmeb 4096 Mar 29 20:01 .
drwxr-xr-x 4 znmeb znmeb 4096 Mar 29 20:01 pandaid_base
drwx------ 19 999 root 4096 Mar 29 20:03 postgres-data
drwxr-xr-x 8 znmeb znmeb 4096 Mar 29 20:05 .git
If we use this method we'll need to add postgres-data
to .gitignore
.
I tried to merge, but am being told there is a merge conflict.... can I get some help on resolving?
I'll take a look at it - I'm sure it's something simple in .gitignore
.
OK - it's fixed - it was in the comments! You can go ahead and merge if you want to.
Haha! Figures. Ok, thank you!
On Thu, Apr 2, 2020 at 3:37 PM M. Edward (Ed) Borasky < notifications@github.com> wrote:
OK - it's fixed - it was in the comments! You can go ahead and merge if you want to.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Pand-Aid/pandaid-api/pull/2#issuecomment-608127693, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHZUNFBC2G7YLNOFHZJDBETRKUHT5ANCNFSM4LS4N5EA .
Brianna Harris Lilka, Inc
If we persist the database data in the repo tree, should we add it to the
.gitignore
to prevent any database data from accidentally ending up on GitHub? At least when it moves into production?