Spaces:
Paused
Paused
File size: 1,022 Bytes
3b536e0 d94d354 fc315e7 d94d354 e2a1596 |
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 35 36 37 38 39 40 41 42 43 |
FROM python:3.9
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
ENV PATH="/root/.cargo/bin:${PATH}"
# Install uv for faster package management
RUN pip install --no-cache-dir uv
# Copy requirements first for better caching
COPY requirements.txt .
# Install Python dependencies with Rust support
RUN . $HOME/.cargo/env && uv pip install --system -r requirements.txt
# Copy application code
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
COPY --chown=user . /app
# HuggingFace environment variables
ENV HF_TOKEN=""
ENV HF_API_BASE="https://huggingface.co/static-proxy/api-inference.huggingface.co"
# Application configuration
ENV OPENAI_API_KEY=""
ENV ANTHROPIC_API_KEY=""
ENV LOG_LEVEL="INFO"
# Expose ports
EXPOSE 7860 8000
# Health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=60s --retries=3 \
CMD curl -f http://localhost:7860/ || exit 1
# Gradio apps run on port 7860 by default
CMD ["python", "app.py"]
|