services: tanzg: build: . container_name: tanzg restart: unless-stopped ports: - "5002:5002" environment: PORT: 5002 # /api/recommend 会联网分析多只股票,默认 Gunicorn 30 秒容易超时 GUNICORN_TIMEOUT: 180 GUNICORN_WORKER_CLASS: gthread GUNICORN_THREADS: 4 # 如果服务器访问新闻源慢,可设为 1 跳过新闻抓取,推荐接口会更快 SKIP_STOCK_NEWS: 0 # 默认使用本地 SQLite:/app/data/history.db SQLITE_PATH: /app/data/history.db # 使用远程 PostgreSQL 时,任选其一: # DATABASE_URL: postgresql://postgres:password@postgres-host:5432/tanzg # PGHOST: postgres-host # PGPORT: 5432 # PGDATABASE: tanzg # PGUSER: postgres # PGPASSWORD: password volumes: - ./data:/app/data