Spaces:
Running
Running
Download Dockerfile from sisithefox/astrology-ziwei-api: direct link, hf CLI and curl.
- Browser
- Download file 2.69 kB
-
https://huggingface.co/spaces/sisithefox/astrology-ziwei-api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/sisithefox/astrology-ziwei-api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/sisithefox/astrology-ziwei-api/resolve/main/Dockerfile
2.69 kB
| # 🔮 Ziwei Doushu API Dockerfile | |
| # Multi-stage build: Node.js + Python | |
| # 2026-10-23: Node 18 (EOL) → 22.23.4, the patched release from the 2026-10-21 Node.js security advisory. | |
| # Pin the exact version so a rebuild never silently picks up an older image. | |
| FROM node:22.23.4-slim AS node-base | |
| WORKDIR /app | |
| # Install Node.js dependencies | |
| COPY package*.json ./ | |
| RUN npm install --production | |
| # Copy Node.js service | |
| COPY ziwei_service.js ./ | |
| # Python stage | |
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # Node runtime: copy the patched binary + npm from the node stage instead of Debian's apt nodejs | |
| # (apt gave Node 18, which no longer receives security fixes). npm is only a fallback for ensure_node_dependencies(). | |
| COPY --from=node-base /usr/local/bin/node /usr/local/bin/node | |
| COPY --from=node-base /usr/local/lib/node_modules/npm /usr/local/lib/node_modules/npm | |
| RUN ln -s ../lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && node --version && npm --version | |
| # Copy Node.js files from previous stage | |
| COPY --from=node-base /app/node_modules ./node_modules | |
| COPY --from=node-base /app/package.json ./package.json | |
| COPY --from=node-base /app/ziwei_service.js ./ziwei_service.js | |
| # Copy Python requirements | |
| COPY requirements.txt ./ | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy Python application and modules | |
| COPY app.py ./ | |
| COPY sihua_analyzer.py ./ | |
| COPY sihua_data.py ./ | |
| COPY ai_interpreter.py ./ | |
| # 2026-07-12 Phase 3: 四层schema(meta/strength/timing/evidence) — 漏COPY会导致 | |
| # HF Space构建后 `from evidence import ...` ImportError,务必跟app.py一起加 | |
| COPY evidence.py ./ | |
| COPY terms.py ./ | |
| # Copy v3.5+ knowledge-enhanced modules | |
| COPY knowledge_enhanced_interpreter.py ./ | |
| COPY palace_strength.py ./ | |
| COPY star_brightness_table.py ./ | |
| # Copy v3.6 San Fang Si Zheng module | |
| COPY san_fang_si_zheng_analyzer.py ./ | |
| # Copy v3.7 Pattern Recognition modules | |
| COPY geju_patterns.py ./ | |
| COPY geju_matcher.py ./ | |
| # Copy v3.8 Star Combination modules | |
| COPY star_combination_rules.py ./ | |
| COPY star_combination_matcher.py ./ | |
| # Copy v3.18 Daxun Analyzer module (NEW!) | |
| COPY daxun_analyzer.py ./ | |
| # Copy v3.19 Resolution Advisory module (NEW!) | |
| COPY resolution_advisor.py ./ | |
| # Copy v3.20 Liuyue Analyzer module (NEW!) | |
| COPY liuyue_analyzer.py ./ | |
| # Copy v4.0 Barnum + Six Relations + Reading Methodology modules (NEW!) | |
| COPY barnum_cold_reader.py ./ | |
| COPY methodology_loader.py ./ | |
| COPY six_relations_interpreter.py ./ | |
| COPY reading_methodology.py ./ | |
| # Copy remaining files | |
| COPY README.md ./ | |
| # Expose port 7860 (required by Hugging Face Spaces) | |
| EXPOSE 7860 | |
| # Run the FastAPI application | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |