feat: 新增 AFFiNE (#1954)

This commit is contained in:
wanghe
2024-08-20 17:50:30 +08:00
committed by GitHub
parent 0e92701efe
commit 2c7d36b2bc
5 changed files with 148 additions and 0 deletions
+74
View File
@@ -0,0 +1,74 @@
additionalProperties:
formFields:
- default: 3010
envKey: PANEL_APP_PORT_HTTP
labelEn: Web Port
labelZh: HTTP 端口
required: true
rule: paramPort
type: number
- default: 5555
envKey: PANEL_APP_PORT_HTTP_5555
labelEn: Port
labelZh: 端口
required: true
rule: paramPort
type: number
- default: ""
edit: true
envKey: AFFINE_ADMIN_EMAIL
labelEn: email
labelZh: 管理员邮箱
required: true
type: text
- default: ""
edit: true
envKey: AFFINE_ADMIN_PASSWORD
labelEn: password
labelZh: 管理员密码
required: true
type: password
- default: ""
envKey: PANEL_DB_HOST
key: postgresql
labelEn: PostgreSQL Database Service
labelZh: PostgreSQL 数据库服务
required: true
type: service
- default: affine
envKey: PANEL_DB_NAME
labelEn: Database
labelZh: 数据库名
random: true
required: true
rule: paramCommon
type: text
- default: affine
envKey: PANEL_DB_USER
labelEn: User
labelZh: 数据库用户
random: true
required: true
rule: paramCommon
type: text
- default: affine
envKey: PANEL_DB_USER_PASSWORD
labelEn: Password
labelZh: 数据库用户密码
random: true
required: true
rule: paramComplexity
type: password
- default: ""
envKey: PANEL_REDIS_HOST
key: redis
labelEn: Redis Service
labelZh: redis 服务
required: true
type: service
- default: ""
disabled: true
envKey: PANEL_REDIS_ROOT_PASSWORD
labelEn: Password
labelZh: redis 密码
type: text
+34
View File
@@ -0,0 +1,34 @@
services:
affine:
image: ghcr.io/toeverything/affine-graphql:stable
container_name: ${CONTAINER_NAME}
restart: unless-stopped
ports:
- ${PANEL_APP_PORT_HTTP}:3010
- ${PANEL_APP_PORT_HTTP_5555}:5555
command:
['sh', '-c', 'node ./scripts/self-host-predeploy && node ./dist/index.js']
volumes:
- ./data/storage:/root/.affine/storage
- ./data/config:/root/.affine/config
networks:
- 1panel-network
environment:
- NODE_OPTIONS="--import=./scripts/register.js"
- AFFINE_CONFIG_PATH=/root/.affine/config
- REDiIS_SERVER_HOST=${REDIS_HOST}
- REDIS_SERVER_PORT=6379
- REDIS_SERVER_PASSWORD=${PANEL_REDIS_ROOT_PASSWORD}
- DATABASE_URL=postgres://${PANEL_DB_USER}:${PANEL_DB_USER_PASSWORD}@${PANEL_DB_HOST}:${PANEL_DB_PORT}/${PANEL_DB_NAME}
- NODE_ENV=production
- AFFINE_ADMIN_EMAIL=${AFFINE_ADMIN_EMAIL}
- AFFINE_ADMIN_PASSWORD=${AFFINE_ADMIN_PASSWORD}
logging:
driver: 'json-file'
options:
max-size: '1000m'
labels:
createdBy: "Apps"
networks:
1panel-network:
external: true