Profile picture

Software Engineer (Open Source, Dev Tools) at BoxyHQ.

Follow me on Twitter

PostgreSQL + pgAdmin Docker Compose

August 07, 2022

version: "3"

services:
  db:
    image: postgres
    restart: always
    ports:
      - "54320:5432"
    environment:
      POSTGRES_USER: admin
      POSTGRES_PASSWORD: password
    volumes:
      - local_pgdata:/var/lib/postgresql/data
    networks:
      - postgres-pgadmin

  pgadmin:
    image: dpage/pgadmin4
    restart: always
    ports:
      - "5050:80"
    environment:
      PGADMIN_DEFAULT_EMAIL: kiran@example.com
      PGADMIN_DEFAULT_PASSWORD: password
    volumes:
      - pgadmin-data:/var/lib/pgadmin
    networks:
      - postgres-pgadmin

networks:
  postgres-pgadmin:

volumes:
  local_pgdata:
  pgadmin-data:

Kiran K