Thursday, July 25, 2019

PostgreSQL docker using Docker Compose

Create a docker-compose.yml file like below:

version: '3'

services:
  db:
    image: postgres:latest
    restart: always
    ports:
      - 5432:5432
    environment:
      POSTGRES_PASSWORD: 'postgres'
    volumes:
      - database_data:/var/lib/postgresql/data

volumes:
  database_data:
    driver: local

User below command to start docker compose:

docker-compose up

Install pgAdmin client to connect started PostgreSQL docker:







No comments:

Post a Comment