contractpulse / Dockerfile
GitHub Actions
sync: bug fixes-8 (127d34b99d54db6691aa8dcebf7db87ffdc0073c)
ec1ec6e
raw
history blame contribute delete
704 Bytes
FROM python:3.10-slim
# Create non-root user — REQUIRED by HuggingFace Spaces
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
# Install system dependencies
RUN pip install --no-cache-dir --upgrade pip
# Copy and install requirements first (better caching)
COPY --chown=user requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy everything else including data/Stocks
COPY --chown=user . /app
# Debug line — remove after confirming files are present
RUN ls /app/data/Stocks/ | head -5 && echo "DATA FILES OK"
# HuggingFace Spaces only works on port 7860
EXPOSE 7860
# Start Flask directly
CMD ["python", "main.py"]