Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
File size: 749 Bytes
d1ed69b |
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 |
# Use Python 3.12.1 slim image as base
FROM python:3.12.1-slim
# Install dependencies required for UV and Python packages
RUN apt-get update && apt-get install -y --no-install-recommends \
curl ca-certificates git && \
rm -rf /var/lib/apt/lists/*
# Install UV (fast Python dependency manager)
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
# Ensure UV is available in PATH
ENV PATH="/root/.local/bin:$PATH"
# Set working directory
WORKDIR /app
# Copy pyproject and install dependencies using UV
COPY pyproject.toml .
RUN uv venv && uv sync
# Copy application code
COPY app.py .
# Expose Gradio app port
EXPOSE 7860
ENV GRADIO_SERVER_NAME="0.0.0.0"
# Entrypoint to run the Gradio app
ENTRYPOINT ["uv", "run", "python", "app.py"]
|