Spaces:
Running
Running
File size: 888 Bytes
ec38125 78b41d5 76b1cf2 78b41d5 9bbca5d 78b41d5 b590cea 78b41d5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | FROM python:3.12-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Clone the bazi library — pinned to a fixed commit (2026-07-09) so upstream
# changes/deletions can't silently alter or break our production builds
RUN git clone https://github.com/china-testing/bazi.git /app/bazi_lib \
&& git -C /app/bazi_lib checkout 7150d5b6fba5e563dd0751b957dc990bb84ab6f0
# Copy all application code
COPY *.py .
# Copy data directory for rituals database
COPY data/ ./data/
# Expose port 7860 (required by Hugging Face Spaces)
EXPOSE 7860
# Run the application
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|