mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-01 12:06:38 +08:00
Improve large library storage backends and scans
This commit is contained in:
@@ -25,6 +25,9 @@ services:
|
||||
container_name: mediastation-go
|
||||
restart: unless-stopped
|
||||
init: true
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
|
||||
# 浏览器访问端口。
|
||||
# 如果 18080 被占用,可以改成 "19011:8080" 之类。
|
||||
@@ -74,6 +77,13 @@ services:
|
||||
MEDIASTATION_APP_PORT: 8080
|
||||
MEDIASTATION_APP_WEB_DIR: /app/web/dist
|
||||
MEDIASTATION_APP_DATA_DIR: /data
|
||||
|
||||
# 轻量模式默认只使用 PostgreSQL,适合大多数 NAS。
|
||||
# 旧版 ./data/mediastation.db 存在时,首次启动会自动迁移到 PostgreSQL。
|
||||
MEDIASTATION_DATABASE_TYPE: postgres
|
||||
MEDIASTATION_DATABASE_DSN: postgres://mediastation:mediastation@postgres:5432/mediastation?sslmode=disable
|
||||
|
||||
# SQLite 旧库位置:仅用于旧数据自动迁移和无 PG 回退。
|
||||
MEDIASTATION_DATABASE_DB_PATH: /data/mediastation.db
|
||||
MEDIASTATION_CACHE_CACHE_DIR: /cache
|
||||
|
||||
@@ -109,3 +119,26 @@ services:
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
container_name: mediastation-postgres
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: mediastation
|
||||
POSTGRES_USER: mediastation
|
||||
POSTGRES_PASSWORD: mediastation
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
# PostgreSQL 主数据目录。升级/重建容器时必须保留。
|
||||
- ./postgres:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U mediastation -d mediastation"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "10m"
|
||||
max-file: "3"
|
||||
|
||||
Reference in New Issue
Block a user