I'm running a docker container with Laravel 5 and I have PostgreSQL on my machine.
Everything works perfectly, except that I have waaaay to many data on my DB and that made seeding to take about 1 hour. The workaround I came up with is to restore a backup file (data only) that would seed the database for me in about 5 min.
Awesome! But...
Laravel is running inside the docker container, and PostgreSQL is not, so when Laravel does
$cmd = "pg_restore -v -U pgadmin -d $database $path";
exec($cmd);
I get an error saying that there is no pg_restore to execute.
sh: 1: pg_restore: not found
So, finally, my question is: How can I make Laravel to be able to execute pg_restore?
Obs: it works when also running Laravel on the machine, but I really need to solve it with Laravel on docker and postgres outside.
Thanks in advance!
UPDATE:
I editted the docker-compose.yml and added the following line under volumes
./usr/bin/pg_restore:/usr/bin/pg_restore
Now the error is just
sh: 1: pg_restore: Permission denied
It means now it "sees" the pg_restore command but does not have rights to execute it, since it's running inside a docker container.... how can i solve this one?