본문 바로가기

IT

docker compose로 postgresql 실행하는법

반응형
#Postgresql-compose.yml
version: '3'
services:
  db:
    image: postgres:latest
    restart: always
    environment:
      POSTGRES_USER: ###############################
      POSTGRES_PASSWORD: #################################
      POSTGRES_DB: ###############################
    ports:
      - "5432:5432"
    volumes:
      - ./postgres-data:/var/lib/postgresql/data

 

 

 #postgresql 
 $docker-compose -f .\postgresql-compose.yml up -d