https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-18-04
Use these following commands, this will solve the error:
sudo apt-get install postgresql then fire:
sudo apt-get install python-psycopg2 and last:
sudo apt-get install libpq-dev
pip install psycopg2
https://www.pgadmin.org/download/pgadmin-4-apt/
docker-compose logs -f
docker-compose up --build -d --remove-orphans
docker exec -ti efd8 psql -U postgres
docker volume create --name=postgres-v12
version: '3.1'
services:
postgres:
image: postgres:12
container_name: "postgres-v12"
ports:
- 5432:5432
environment:
POSTGRES_PASSWORD: admin
volumes:
- db_vol:/var/lib/postgresql/data
pgadmin:
image: dpage/pgadmin4
container_name: pgadmin4
ports:
- 3333:80
environment:
PGADMIN_DEFAULT_EMAIL: admin
PGADMIN_DEFAULT_PASSWORD: admin
volumes:
db_vol:
external:
name: "postgres-v12"