Docker Compose로 PostgreSQL 실행하기

- docker-compose.yml

# docker-compose.yml

version: '3.7'

services:
  postgresql:
    container_name: postgresql
    image: postgres:13.4
    init: true
    restart: always
    volumes:
      - ./volume/data:/var/lib/postgresql/data
    ports:
      - 5432:5432
    environment:
      POSTGRES_USER: { username }
      POSTGRES_PASSWORD: { password }