advanced / Dockerfile
Alina Lozovskaya
First commit
d1ed69b
raw
history blame
749 Bytes
# 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"]