docker-compose安装postsql(PostgreSQL)数据库

 

docker-compose.yml

version: '3'
services:
 db:  
  container_name: pgsql
  restart: always
  image: postgres:latest
  privileged: true
  ports:
    - 5432:5432
  environment:
    POSTGRES_PASSWORD: root #密码
    PGDATA: /var/lib/postgresql/data/pgdata
  volumes:
    - /data/pgdata:/var/lib/postgresql/data/pgdata

 

posted @ 2022-01-29 11:02  yvioo  阅读(740)  评论(0编辑  收藏  举报