you can use PGADMIN from windows client, or the pgsql client on command line.
the trick is getting the IP address from the docker inspect commandÂ
i use this, not eloquent but worksÂ
#!/bin/bash
# Â Â Note if you are rails person use rake migrations :)
#install psql client
# Â apt install postgresql-client-common
# Â apt install postgresql-client
# Â Get PGPASSWORD from /root/greenlight-v3/.env
# Â Get ip address from docker inspect container postgres (NOTE this ip changes with a docker compose down)
pgpass=$(cat .env | grep DATABASE_URL | cut -d':' -f3 | cut -d'@' -f1)
export PGPASSWORD=$pgpass
ipaddr=$(docker inspect postgres | grep "IPAddress" | tail -n1 | cut -d'"' -f4)
export POSTGRES=$ipaddr
then run your sql
psql -a -h $POSTGRES -d greenlight-v3-production postgres -f yourcode.sql
Regards,
Stephen