发布应用 PostgreSQL PostGIS 扩展版

Signed-off-by: Meng Sen <qyg2297248353@gmail.com>
This commit is contained in:
Meng Sen
2025-08-13 15:28:26 +08:00
parent adccf65f9c
commit 634267f88b
31 changed files with 396 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
additionalProperties:
formFields:
- default: "/home/postgres"
edit: true
envKey: POSTGRES_ROOT_PATH
labelZh: 数据持久化路径
labelEn: Data persistence path
required: true
type: text
- default: ""
edit: false
envKey: POSTGRES_PASSWORD
labelZh: Postgres 密码 (首次生效)
labelEn: Postgres Password (First Time)
required: true
random: true
rule: paramComplexity
type: password
- default: 5432
edit: true
envKey: PANEL_APP_PORT_HTTP
labelZh: Postgres 端口
labelEn: Postgres Port
required: true
rule: paramPort
type: number
- default: "postgres"
edit: false
envKey: POSTGRES_USER
labelZh: Postgres 用户(不建议改动)
labelEn: Postgres User
required: false
type: text
- default: "postgres"
edit: false
envKey: POSTGRES_DB
labelZh: Postgres 数据库名称(不建议改动)
labelEn: Postgres Database Name
required: false
type: text

View File

@@ -0,0 +1,25 @@
networks:
1panel-network:
external: true
services:
postgresql:
image: postgis/postgis:16-3.5-alpine
container_name: ${CONTAINER_NAME}
labels:
createdBy: "Apps"
restart: always
networks:
- 1panel-network
ports:
- ${PANEL_APP_PORT_HTTP}:5432
env_file:
- ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env}
- ${ENV_FILE:-/etc/1panel/envs/default.env}
volumes:
- ${POSTGRES_ROOT_PATH}/data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-postgres}
POSTGRES_INITDB_ARGS: "--data-checksums"

View File

@@ -0,0 +1,40 @@
additionalProperties:
formFields:
- default: "/home/postgres"
edit: true
envKey: POSTGRES_ROOT_PATH
labelZh: 数据持久化路径
labelEn: Data persistence path
required: true
type: text
- default: ""
edit: false
envKey: POSTGRES_PASSWORD
labelZh: Postgres 密码 (首次生效)
labelEn: Postgres Password (First Time)
required: true
random: true
rule: paramComplexity
type: password
- default: 5432
edit: true
envKey: PANEL_APP_PORT_HTTP
labelZh: Postgres 端口
labelEn: Postgres Port
required: true
rule: paramPort
type: number
- default: "postgres"
edit: false
envKey: POSTGRES_USER
labelZh: Postgres 用户(不建议改动)
labelEn: Postgres User
required: false
type: text
- default: "postgres"
edit: false
envKey: POSTGRES_DB
labelZh: Postgres 数据库名称(不建议改动)
labelEn: Postgres Database Name
required: false
type: text

View File

@@ -0,0 +1,25 @@
networks:
1panel-network:
external: true
services:
postgresql:
image: postgis/postgis:16-3.5
container_name: ${CONTAINER_NAME}
labels:
createdBy: "Apps"
restart: always
networks:
- 1panel-network
ports:
- ${PANEL_APP_PORT_HTTP}:5432
env_file:
- ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env}
- ${ENV_FILE:-/etc/1panel/envs/default.env}
volumes:
- ${POSTGRES_ROOT_PATH}/data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-postgres}
POSTGRES_INITDB_ARGS: "--data-checksums"

View File

@@ -0,0 +1,40 @@
additionalProperties:
formFields:
- default: "/home/postgres"
edit: true
envKey: POSTGRES_ROOT_PATH
labelZh: 数据持久化路径
labelEn: Data persistence path
required: true
type: text
- default: ""
edit: false
envKey: POSTGRES_PASSWORD
labelZh: Postgres 密码 (首次生效)
labelEn: Postgres Password (First Time)
required: true
random: true
rule: paramComplexity
type: password
- default: 5432
edit: true
envKey: PANEL_APP_PORT_HTTP
labelZh: Postgres 端口
labelEn: Postgres Port
required: true
rule: paramPort
type: number
- default: "postgres"
edit: false
envKey: POSTGRES_USER
labelZh: Postgres 用户(不建议改动)
labelEn: Postgres User
required: false
type: text
- default: "postgres"
edit: false
envKey: POSTGRES_DB
labelZh: Postgres 数据库名称(不建议改动)
labelEn: Postgres Database Name
required: false
type: text

View File

@@ -0,0 +1,25 @@
networks:
1panel-network:
external: true
services:
postgresql:
image: postgis/postgis:17-3.5-alpine
container_name: ${CONTAINER_NAME}
labels:
createdBy: "Apps"
restart: always
networks:
- 1panel-network
ports:
- ${PANEL_APP_PORT_HTTP}:5432
env_file:
- ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env}
- ${ENV_FILE:-/etc/1panel/envs/default.env}
volumes:
- ${POSTGRES_ROOT_PATH}/data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-postgres}
POSTGRES_INITDB_ARGS: "--data-checksums"

View File

@@ -0,0 +1,40 @@
additionalProperties:
formFields:
- default: "/home/postgres"
edit: true
envKey: POSTGRES_ROOT_PATH
labelZh: 数据持久化路径
labelEn: Data persistence path
required: true
type: text
- default: ""
edit: false
envKey: POSTGRES_PASSWORD
labelZh: Postgres 密码 (首次生效)
labelEn: Postgres Password (First Time)
required: true
random: true
rule: paramComplexity
type: password
- default: 5432
edit: true
envKey: PANEL_APP_PORT_HTTP
labelZh: Postgres 端口
labelEn: Postgres Port
required: true
rule: paramPort
type: number
- default: "postgres"
edit: false
envKey: POSTGRES_USER
labelZh: Postgres 用户(不建议改动)
labelEn: Postgres User
required: false
type: text
- default: "postgres"
edit: false
envKey: POSTGRES_DB
labelZh: Postgres 数据库名称(不建议改动)
labelEn: Postgres Database Name
required: false
type: text

View File

@@ -0,0 +1,25 @@
networks:
1panel-network:
external: true
services:
postgresql:
image: postgis/postgis:17-3.5
container_name: ${CONTAINER_NAME}
labels:
createdBy: "Apps"
restart: always
networks:
- 1panel-network
ports:
- ${PANEL_APP_PORT_HTTP}:5432
env_file:
- ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env}
- ${ENV_FILE:-/etc/1panel/envs/default.env}
volumes:
- ${POSTGRES_ROOT_PATH}/data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-postgres}
POSTGRES_INITDB_ARGS: "--data-checksums"

View File

@@ -0,0 +1,29 @@
#!/bin/bash
if [ -f .env ]; then
source .env
# setup-1 add default values
CURRENT_DIR=$(pwd)
sed -i '/^ENV_FILE=/d' .env
sed -i '/^GLOBAL_ENV_FILE=/d' .env
sed -i '/^APP_ENV_FILE=/d' .env
echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env
echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env
echo "APP_ENV_FILE=${CURRENT_DIR}/envs/outline.env" >> .env
# setup-2 remove empty values
sed -i '/^.*=""/d' .env
# setup-3 update directory permissions
mkdir -p "$OUTLINE_ROOT_PATH"
mkdir -p "$OUTLINE_ROOT_PATH/data"
chown -R 1001:1001 "$OUTLINE_ROOT_PATH"
chmod -R 1777 "$OUTLINE_ROOT_PATH"
echo "Check Finish."
else
echo "Error: .env file not found."
fi

View File

@@ -0,0 +1,10 @@
#!/bin/bash
if [ -f .env ]; then
source .env
echo "Check Finish."
else
echo "Error: .env file not found."
fi

View File

@@ -0,0 +1,29 @@
#!/bin/bash
if [ -f .env ]; then
source .env
# setup-1 add default values
CURRENT_DIR=$(pwd)
sed -i '/^ENV_FILE=/d' .env
sed -i '/^GLOBAL_ENV_FILE=/d' .env
sed -i '/^APP_ENV_FILE=/d' .env
echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env
echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env
echo "APP_ENV_FILE=${CURRENT_DIR}/envs/outline.env" >> .env
# setup-2 remove empty values
sed -i '/^.*=""/d' .env
# setup-3 update directory permissions
mkdir -p "$OUTLINE_ROOT_PATH"
mkdir -p "$OUTLINE_ROOT_PATH/data"
chown -R 1001:1001 "$OUTLINE_ROOT_PATH"
chmod -R 1777 "$OUTLINE_ROOT_PATH"
echo "Check Finish."
else
echo "Error: .env file not found."
fi

View File

@@ -0,0 +1,54 @@
# PostgreSQL (PostGIS)
### PostgreSQL世界上最先进的开源关系数据库
![PostgreSQL](https://file.lifebus.top/imgs/postgresql_logo.png)
![](https://img.shields.io/badge/%E6%96%B0%E7%96%86%E8%90%8C%E6%A3%AE%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91%E5%B7%A5%E4%BD%9C%E5%AE%A4-%E6%8F%90%E4%BE%9B%E6%8A%80%E6%9C%AF%E6%94%AF%E6%8C%81-blue)
## PostGIS 扩展
PostGIS 通过添加对存储、索引和查询地理空间数据的支持来扩展 PostgreSQL 关系数据库的功能。
## 简介
PostgreSQL 是一个功能强大的开源对象关系型数据库系统,它使用并扩展了 SQL 语言并结合了多种功能可以安全地存储和扩展最复杂的数据工作负载。PostgreSQL
起源于 1986 年加州大学伯克利分校的 POSTGRES 项目,在核心平台上已有超过 35 年的活跃开发历史。
PostgreSQL 因其成熟的架构、可靠性、数据完整性、强大的功能集、可扩展性,以及该软件背后的开源社区为持续提供高性能和创新解决方案所做出的奉献而赢得了良好的声誉。
PostgreSQL 可在所有主流操作系统上运行,自 2001 年以来一直符合 ACID 标准,并拥有强大的附加功能,如广受欢迎的 PostGIS
地理空间数据库扩展器。因此PostgreSQL 成为许多人和组织首选的开源关系数据库也就不足为奇了。
开始使用PostgreSQL从未如此简单--选择一个你想建立的项目让PostgreSQL安全稳健地存储你的数据。
### 为什么使用 PostgreSQL
PostgreSQL 具有许多功能旨在帮助开发人员构建应用程序帮助管理员保护数据完整性和构建容错环境并帮助您管理数据无论数据集大小。除了免费和开源之外PostgreSQL
还具有高度可扩展性。例如,您可以定义自己的数据类型,创建自定义函数,甚至可以使用不同的编程语言编写代码,而无需重新编译数据库!
在不违背传统功能或可能导致架构决策失误的情况下PostgreSQL 会尽量符合 SQL 标准。SQL 标准所要求的许多功能都得到了支持,尽管有时语法或功能略有不同。
随着时间的推移,有望进一步实现一致性。截至 2023 年 9 月发布的第 16 版PostgreSQL 至少符合 SQL:2023 核心一致性 179 个强制功能中的
170 个。
截至目前,还没有关系型数据库完全符合这一标准。
## 版本选择
- `vectors` - 内置 vectors 插件。
+ 插件名称vectors
+ 插件描述vectors 插件用于存储和查询矢量数据,如地理坐标、几何图形等。
+ 插件链接:[https://github.com/tensorchord/pgvecto.rs](https://github.com/tensorchord/pgvecto.rs)
- `alpine` - 基于 Alpine Linux 发行版。
+ 精简版 PostgreSQL基于 Alpine Linux 发行版,提供了更小的镜像体积和更快的启动速度。
- `{version}` 默认版
+ 官方默认 PostgreSQL 版本,基于 Debian Linux 发行版。
---
![Ms Studio](https://file.lifebus.top/imgs/ms_blank_001.png)

View File

@@ -0,0 +1,14 @@
additionalProperties:
key: postgresql-postgis
name: PostgreSQL (PostGIS)
tags:
- Database
- Local
shortDescZh: 开源关系型数据库
shortDescEn: Open Source Relational Database
type: runtime
crossVersionUpdate: false
limit: 0
website: https://www.postgresql.org/
github: https://github.com/postgres/postgres/
document: https://www.postgresql.org/docs/

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB