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: additionalProperties:
formFields: formFields:
- default: "" - child:
envKey: PANEL_DB_HOST default: ""
key: mysql envKey: PANEL_DB_HOST
required: true
type: service
default: mysql
envKey: PANEL_DB_TYPE
labelEn: Database Service labelEn: Database Service
labelZh: 数据库服务 labelZh: 数据库服务
required: true required: true
type: service type: apps
values:
- label: MySQL
value: mysql
- label: PostgreSQL
value: postgresql
- default: umami - default: umami
envKey: PANEL_DB_NAME envKey: PANEL_DB_NAME
labelEn: Database labelEn: Database

View File

@ -1,7 +1,7 @@
version: '3' version: '3'
services: services:
umami: 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} container_name: ${CONTAINER_NAME}
restart: always restart: always
labels: labels:
@ -9,8 +9,8 @@ services:
ports: ports:
- ${PANEL_APP_PORT_HTTP}:3000 - ${PANEL_APP_PORT_HTTP}:3000
environment: environment:
DATABASE_TYPE: mysql DATABASE_TYPE: ${PANEL_DB_TYPE}
DATABASE_URL: mysql://${PANEL_DB_USER}:${PANEL_DB_USER_PASSWORD}@${PANEL_DB_HOST}:3306/${PANEL_DB_NAME} 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} HASH_SALT: ${HASH_SALT}
networks: networks:
- 1panel-network - 1panel-network