-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Postgres does not keep data after docker-compose down #1445
Comments
@bestlong |
run
hav any error message? |
I do not think so, here is the full output: https://pastebin.com/SdhQxk50 |
make sure docker-compose.yml about postgresql part like:
and build image again
|
Tried that, did not work. This is diff of your config (left) and my config (right): https://www.diffchecker.com/VCVy7Dyc I ssh'd into the postgres container:
So the directories are in the container, but they do not get written onto host disk. |
you will get detail info. my result a part:
|
Everything looks fine, here is extracted info relating to volumes:
Do you see anything wrong? Here is the full output: https://pastebin.com/ysEiYWfLput |
Solved, see here: https://stackoverflow.com/questions/41637505/how-to-persist-data-in-a-dockerized-postgres-database-using-volumes The gist of it is to change this:
to this
Note the extra data after /postgresql/ i think we should update laradock's docker-compose.yml to reflect this behaviour. |
my os is MAC, i will try it again at ubuntu . |
i think #1421 can fix this. |
Yes, that should do it, will have to wait for the build to pass. |
Any updates on this issue? |
Hi 👋 this issue has been automatically marked as |
Hi again 👋 we would like to inform you that this issue has been automatically |
Info:
$ docker --version
): Docker version 17.12.0-ce, build c97c6d6$ git rev-parse HEAD
): 9a9d30fIssue:
No data gets created for postgres, the
data/postgres
directory is empty even after running migrations and filling some data into tables. As a consequence, whenever i dodocker-compose down
and thendocker-compose up
the database is empty. Also, i noticed that the postgres data folder is owned by root, but this worked with mysql, mysql retained data in database even after container restart.Expected behavior:
Postgres should retain data between container restart
Reproduce:
Clone laradock
Set data path in .env to
./data
Start containers
Setup posgtres
Create some tables
fill tables with test data
Stop containers
Start containers - postgres is empty
Relevant Code:
laradock .env
Here is my full .env - https://pastebin.com/0LU7G5wx
Edit
It also does not work when setting
DATA_SAVE_PATH
to ~/.laradock/dataEdit 2
It works for MySQL, the data folder gets created with
999:docker
group and ownerThe text was updated successfully, but these errors were encountered: