Spaces:
Sleeping
Sleeping
# Use Python 3.12 as the base image | |
FROM python:3.12 | |
# Set working directory | |
WORKDIR /code | |
# Copy requirements and install dependencies | |
COPY ./requirements.txt /code/requirements.txt | |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
# Copy application files | |
COPY . /code/app | |
# Hugging Face Spaces does NOT support --mount=type=secret. | |
# Instead, access HF_TOKEN via environment variables at runtime. | |
CMD huggingface-cli login --token "$HF_TOKEN" --add-to-git-credential && \ | |
streamlit run app.py \ | |
--server.headless true \ | |
--server.enableCORS false \ | |
--server.enableXsrfProtection false \ | |
--server.fileWatcherType none |