Configure default Docker Compose install

This commit is contained in:
ShukeBta
2026-05-28 18:08:40 +08:00
parent caab131398
commit e146177b59
4 changed files with 55 additions and 43 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ deploy:
# ---- Docker ----
docker:
docker compose up --build -d
docker compose up -d
docker-stop:
docker compose down
+9 -3
View File
@@ -37,7 +37,7 @@ cp config.example.yaml config.yaml
docker compose up -d
```
默认地址:`http://<服务器IP>:8080`
默认地址:`http://<服务器IP>:18080`
默认账号:`admin` / `admin123`
@@ -49,7 +49,13 @@ docker compose up -d
volumes:
- ./data:/data
- ./cache:/cache
- /your/media/path:/media:ro
- ./media:/media:ro
```
可通过环境变量覆盖默认路径和端口:
```bash
MEDIASTATION_HTTP_PORT=18080 MEDIASTATION_MEDIA_DIR=/your/media/path docker compose up -d
```
### 硬件转码
@@ -137,7 +143,7 @@ go build -o bin/mediastation-go ./cmd/server
```bash
make build # 构建前后端
make test # Go 测试
make docker # docker compose up --build -d
make docker # docker compose up -d
make deploy # Linux 一键部署
make docker-push # buildx 多架构推送
```
+9 -3
View File
@@ -37,7 +37,7 @@ cp config.example.yaml config.yaml
docker compose up -d
```
Default URL: `http://<server-ip>:8080`
Default URL: `http://<server-ip>:18080`
Default account: `admin` / `admin123`
@@ -49,7 +49,13 @@ Default account: `admin` / `admin123`
volumes:
- ./data:/data
- ./cache:/cache
- /your/media/path:/media:ro
- ./media:/media:ro
```
Override the default port and media path with environment variables:
```bash
MEDIASTATION_HTTP_PORT=18080 MEDIASTATION_MEDIA_DIR=/your/media/path docker compose up -d
```
### Hardware Transcoding
@@ -137,7 +143,7 @@ go build -o bin/mediastation-go ./cmd/server
```bash
make build # Build frontend and backend
make test # Run Go tests
make docker # docker compose up --build -d
make docker # docker compose up -d
make deploy # Linux one-click deploy
make docker-push # Multi-arch buildx push
```
+36 -36
View File
@@ -1,60 +1,60 @@
version: '3.8'
# ============================================================================
# MediaStationGo — recommended NAS deployment.
# MediaStationGo default Docker Compose install file.
#
# 1. Edit the volume mappings under `volumes:` so that /media points at your
# actual library root (e.g. /volume1/Media).
# 2. (Optional) set MEDIASTATION_SECRETS_JWT_SECRET to a strong random string;
# otherwise one is auto-generated and persisted to /data/.jwt_secret.
# 3. `docker compose up -d` and visit http://<host>:8080 (admin / admin123).
# ============================================================================
# Quick start:
# 1. docker compose pull
# 2. docker compose up -d
# 3. Open http://<host-ip>:18080
#
# Default account:
# admin / admin123
#
# Local persistent folders created next to this file:
# ./data SQLite database, JWT secret, runtime configuration
# ./cache posters, scraped artwork, transcode cache
# ./media optional local media mount; replace with your NAS path if needed
services:
mediastation-go:
build:
context: .
image: ghcr.io/shukebta/mediastation-go:latest
image: ghcr.io/shukebta/mediastation-go:${MEDIASTATION_IMAGE_TAG:-latest}
pull_policy: always
container_name: mediastation-go
restart: unless-stopped
ports:
- "8080:8080"
- "${MEDIASTATION_HTTP_PORT:-18080}:8080"
volumes:
- ./data:/data
- ./cache:/cache
# Mount your media library into /media. Read-only is fine.
# - /volume1/Media:/media:ro
- ${MEDIASTATION_DATA_DIR:-./data}:/data
- ${MEDIASTATION_CACHE_DIR:-./cache}:/cache
- ${MEDIASTATION_MEDIA_DIR:-./media}:/media:ro
environment:
MEDIASTATION_APP_HOST: 0.0.0.0
MEDIASTATION_APP_PORT: 8080
MEDIASTATION_APP_DATA_DIR: /data
MEDIASTATION_APP_WEB_DIR: /app/web/dist
MEDIASTATION_DATABASE_DB_PATH: /data/mediastation.db
MEDIASTATION_CACHE_CACHE_DIR: /cache
MEDIASTATION_LOGGING_LEVEL: info
# MEDIASTATION_TRANSCODER_ENCODER: vaapi # qsv | vaapi | nvenc | (empty=software)
# MEDIASTATION_TRANSCODER_MAX_HEIGHT: 1080
# MEDIASTATION_SECRETS_JWT_SECRET: change-me-to-a-strong-random-string
# MEDIASTATION_APP_CORS_ORIGINS: '["https://media.example.com"]'
PUID: "1000"
PGID: "1000"
TZ: Asia/Shanghai
MEDIASTATION_LOGGING_LEVEL: ${MEDIASTATION_LOGGING_LEVEL:-info}
MEDIASTATION_TRANSCODER_ENCODER: ${MEDIASTATION_TRANSCODER_ENCODER:-}
MEDIASTATION_TRANSCODER_MAX_HEIGHT: ${MEDIASTATION_TRANSCODER_MAX_HEIGHT:-1080}
MEDIASTATION_APP_CORS_ORIGINS: ${MEDIASTATION_APP_CORS_ORIGINS:-}
PUID: ${PUID:-1000}
PGID: ${PGID:-1000}
TZ: ${TZ:-Asia/Shanghai}
# Hardware-accelerated transcoding.
# * Intel iGPU (QSV / VAAPI): mount /dev/dri.
# * NVIDIA NVENC: switch the runtime to nvidia and add `gpus: all`.
# Optional Intel QSV / VAAPI hardware acceleration.
# Uncomment on Linux/NAS hosts with /dev/dri available, then set:
# MEDIASTATION_TRANSCODER_ENCODER=vaapi
# devices:
# - /dev/dri:/dev/dri
# group_add:
# - "989" # match render GID on host
# runtime: nvidia
# deploy:
# resources:
# reservations:
# devices:
# - capabilities: [gpu]
# - "${RENDER_GID:-989}"
# Optional NVIDIA NVENC hardware acceleration.
# Install NVIDIA Container Toolkit on the host, then set:
# MEDIASTATION_TRANSCODER_ENCODER=nvenc
# gpus: all
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8080/api/health || exit 1"]