- run docker desktop
In your project or in a new project, create a docker-compose.yml file with the following content:
version: '3.8'services:postgres:image: postgres:14.2-alpineenvironment:POSTGRES_USER: ${POSTGRES_USER:-postgres}POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}POSTGRES_DB: mydatabasePGDATA: /data/mydatabasevolumes:- pgstore:/var/lib/postgresql/dataports:- '5432:5432'networks:- postgresrestart: unless-stoppedpgadmin:image: dpage/pgadmin4:6.5environment:PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-admin@admin.com}PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}volumes:- pgadmin:/root/.pgadminports:- '5050:80'networks:- postgresdepends_on:- postgresrestart: unless-stoppednetworks:postgres:driver: bridgevolumes:pgstore:pgadmin:
- start todo
docker-compose up
- psql:
docker exec -it node-express-server-rest-api-postgres-1 psql -U <username> <database>
- pgadmin4
http://localhost:5050/ use your email password combination