Docker 安装 PostgreSQL
docker run -it \
--name postgres \
--restart always \
-e POSTGRES_PASSWORD='123456' \
-e ALLOW_IP_RANGE=0.0.0.0/0 \
-p 5433:5432 -d postgres
docker exec -it postgres /bin/bash
su postgres
psql
-- 创建用户
CREATE USER monitor WITH PASSWORD '123456';
-- 创建数据库
CREATE DATABASE testdb OWNER monitor ENCODING 'UTF8';
-- 授权
GRANT ALL PRIVILEGES ON DATABASE testdb TO monitor;