当前位置:   article > 正文

docker-compose安装PolarDB-PG数据库

docker-compose安装PolarDB-PG数据库

参考官方文档 基于单机文件系统部署

一. Mac

1.1 docker-compose.yaml

mkdir -p /Users/wanfei/docker-compose/polardb-pg && cd /Users/wanfei/docker-compose/polardb-pg

cat <<EOF> /Users/wanfei/docker-compose/polardb-pg/docker-compose.yaml
version: '3'
services:
  polardb-pg:
    restart: always
    image: polardb/polardb_pg_local_instance
    container_name: polardb-pg
    environment:
      POLARDB_USER: root
      POLARDB_PASSWORD: root
      TZ: Asia/Shanghai
    volumes:
      - /Users/wanfei/docker-compose/polardb-pg/data:/var/polardb
    ports:
      - 54320-54322:5432-5434
EOF
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

默认数据库:postgres;默认用户名:root

1.2 部署

docker-compose -f /Users/wanfei/docker-compose/polardb-pg/docker-compose.yaml up -d
  • 1

1.3 卸载

docker-compose -f /Users/wanfei/docker-compose/polardb-pg/docker-compose.yaml down
  • 1

4. 连接

在这里插入图片描述

二. Win10

2.1 docker-compose.yaml

mkdir -p /root/i/docker-compose/polardb-pg && cd  /root/i/docker-compose/polardb-pg

cat <<EOF>  /root/i/docker-compose/polardb-pg/docker-compose.yaml
version: '3'
services:
  polardb-pg:
    restart: always
    image: polardb/polardb_pg_local_instance
    container_name: polardb-pg
    environment:
      POLARDB_USER: root
      POLARDB_PASSWORD: root
      TZ: Asia/Shanghai
    volumes:
      -  /root/i/docker-compose/polardb-pg/data:/var/polardb
    ports:
      - 54320-54322:5432-5434
EOF
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

默认数据库:postgres;默认用户名:root

2.2 部署

docker-compose -f  /root/i/docker-compose/polardb-pg/docker-compose.yaml up -d
  • 1

2.3 卸载

docker-compose -f  /root/i/docker-compose/polardb-pg/docker-compose.yaml down
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/喵喵爱编程/article/detail/819023
推荐阅读
相关标签
  

闽ICP备14008679号