Last active
July 16, 2024 14:38
-
-
Save sanbei011/8da66743100221006cfb120f830b5add to your computer and use it in GitHub Desktop.
在Ubuntu22.04上安装Postgresql并配置navicat远程访问权限
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# echo "赋予存储文件夹权限中..." | |
# sudo mkdir -p /var/postgresql | |
# sudo chown 1001:1001 /var/postgresql | |
# sudo chmod 700 /var/postgresql | |
# echo "权限赋予完成!" | |
echo "创建Docker-compose.yml中.." | |
cat <<EOF > docker-compose.yml | |
services: | |
postgres: | |
image: bitnami/postgresql | |
container_name: postgresql | |
ports: | |
- "5432:5432" | |
environment: | |
- POSTGRES_USER=ghr | |
- POSTGRES_PASSWORD=GZH031ghr. | |
- POSTGRESQL_ALLOW_REMOTE_CONNECTIONS=yes | |
- POSTGRESQL_DATABASE=mydatabase | |
volumes: | |
- postgresql_data:/bitnami/postgresql | |
volumes: | |
postgresql_data: | |
driver: local | |
EOF | |
echo "创建完成!" | |
# 启动 Docker Compose | |
docker-compose up -d | |
echo "postgresql,启动!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment