feat: Umami 支持选择 PostgreSQL 数据库

This commit is contained in:
wanghe-fit2cloud 2024-01-22 14:32:44 +08:00
parent 82a12e9e69
commit c161f58550
2 changed files with 16 additions and 7 deletions

View File

@ -1,12 +1,21 @@
additionalProperties:
formFields:
- default: ""
envKey: PANEL_DB_HOST
key: mysql
- child:
default: ""
envKey: PANEL_DB_HOST
required: true
type: service
default: mysql
envKey: PANEL_DB_TYPE
labelEn: Database Service
labelZh: 数据库服务
required: true
type: service
type: apps
values:
- label: MySQL
value: mysql
- label: PostgreSQL
value: postgresql
- default: umami
envKey: PANEL_DB_NAME
labelEn: Database

View File

@ -1,7 +1,7 @@
version: '3'
services:
umami:
image: ghcr.io/umami-software/umami:mysql-v2.8.0
image: ghcr.io/umami-software/umami:${PANEL_DB_TYPE}-v2.8.0
container_name: ${CONTAINER_NAME}
restart: always
labels:
@ -9,8 +9,8 @@ services:
ports:
- ${PANEL_APP_PORT_HTTP}:3000
environment:
DATABASE_TYPE: mysql
DATABASE_URL: mysql://${PANEL_DB_USER}:${PANEL_DB_USER_PASSWORD}@${PANEL_DB_HOST}:3306/${PANEL_DB_NAME}
DATABASE_TYPE: ${PANEL_DB_TYPE}
DATABASE_URL: ${PANEL_DB_TYPE}://${PANEL_DB_USER}:${PANEL_DB_USER_PASSWORD}@${PANEL_DB_HOST}:${PANEL_DB_PORT}/${PANEL_DB_NAME}
HASH_SALT: ${HASH_SALT}
networks:
- 1panel-network