3👍
✅
Assuming you are using a Debian or Ubuntu-based image, in your Dockerfile, you just need to add the line:
RUN apt-get update && apt-get -y install postgresql
That will install the psql command for you and allow you to use the dbshell.
Source:stackexchange.com