oilverse-api / Dockerfile
孙家明
deploy: OilVerse for HuggingFace (Node.js 18 fix)
fab9847
FROM python:3.10-slim
WORKDIR /app
# Install Node.js 18 via NodeSource (Vite requires Node >= 18)
RUN apt-get update && \
apt-get install -y curl && \
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/*
# Copy and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy project files
COPY config.py api_server.py ./
COPY agent/ ./agent/
COPY core/ ./core/
COPY output/ ./output/
COPY data/llm_event_scores.json ./data/llm_event_scores.json
COPY data/consumer_confidence_cache.csv ./data/consumer_confidence_cache.csv
# Build frontend
COPY frontend/ ./frontend/
RUN cd frontend && npm install && npm run build
# Expose port 7860 (HuggingFace Spaces default)
EXPOSE 7860
ENV PYTHONUTF8=1
CMD ["uvicorn", "api_server:app", "--host", "0.0.0.0", "--port", "7860"]