convertor/docs/Docker組合配置/compose.production-alt.example.yml
Your Name 8a84caa503 Refactor Docker Compose examples and documentation
- Updated README.md to include new example files for minimal and production configurations with detailed instructions.
- Added compose.production-alt.example.yml for an annotated production setup.
- Introduced new example files: compose.minimal.example.yml, compose.production.example.yml, nginx.example.conf, and traefik.example.yml for better clarity and usability.
- Removed outdated configuration files and consolidated documentation for OCR language support.
- Adjusted Nginx and Traefik configurations to reflect best practices and added necessary comments for user guidance.
- Minor formatting and consistency improvements across documentation files.
2026-01-24 00:36:58 +08:00

91 lines
2.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ==============================================================================
# ConvertX-CN 生產環境 Docker Compose詳細註解版
#
# 適用情境:
# - 透過 Reverse ProxyNginx / Traefik / Caddy存取
# - 已設定 HTTPS
# - 需要限制註冊與存取
#
# 使用方式:
# 1. cp compose.production-alt.example.yml docker-compose.yml
# 2. mkdir -p data
# 3. 修改 JWT_SECRET必填
# 4. docker compose up -d
#
# 必須修改的欄位:
# - JWT_SECRET
# ==============================================================================
services:
convertx:
image: convertx/convertx-cn:latest
container_name: convertx-cn
restart: unless-stopped
# 生產環境通常只監聽 localhost由 Reverse Proxy 轉發
# 若需要直接對外,改為 "3000:3000"
ports:
- "127.0.0.1:3000:3000"
volumes:
- ./data:/app/data
environment:
# === 必填設定 ===
# ⚠️ JWT 密鑰:請務必改成你自己的隨機字串(至少 32 字元)
# 產生方式openssl rand -hex 32
- JWT_SECRET=YOUR_JWT_SECRET_HERE
# === 安全設定 ===
# 關閉註冊(首次帳號仍可建立)
- ACCOUNT_REGISTRATION=false
# 不允許 HTTP要求 HTTPS
- HTTP_ALLOWED=false
# 信任 Reverse Proxy 的 X-Forwarded-* headers
- TRUST_PROXY=true
# 必須登入才能使用
- ALLOW_UNAUTHENTICATED=false
# === 時區與清理 ===
- TZ=Asia/Taipei
- AUTO_DELETE_EVERY_N_HOURS=24
# === 可選:子路徑部署 ===
# 若透過 https://example.com/convertx/ 存取,取消下行註解
# - WEBROOT=/convertx
# ==============================================================================
# Reverse Proxy 設定範例
# ==============================================================================
#
# Nginx 範例:
# -------------
# server {
# listen 443 ssl http2;
# server_name example.com;
#
# location / {
# proxy_pass http://127.0.0.1:3000;
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Forwarded-Proto $scheme;
#
# # 檔案上傳大小限制
# client_max_body_size 500M;
# }
# }
#
# Traefik 範例labels
# ------------------------
# labels:
# - "traefik.enable=true"
# - "traefik.http.routers.convertx.rule=Host(`convertx.example.com`)"
# - "traefik.http.routers.convertx.tls=true"
# - "traefik.http.routers.convertx.tls.certresolver=letsencrypt"
# - "traefik.http.services.convertx.loadbalancer.server.port=3000"
#
# ==============================================================================