mosaic-zero / Dockerfile.hf
raylim's picture
Add HF Spaces test infrastructure and documentation
db7a6f0 unverified
raw
history blame contribute delete
785 Bytes
# Dockerfile for testing Hugging Face Spaces deployment locally
FROM python:3.11-slim
# Install system dependencies required for openslide and other packages
RUN apt-get update && apt-get install -y \
build-essential \
git \
libopenslide0 \
libopenslide-dev \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy project files needed for installation
COPY pyproject.toml README.md ./
COPY src/ ./src/
# Copy requirements
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application
COPY . .
# Set environment variables
ENV GRADIO_SERVER_NAME=0.0.0.0
ENV GRADIO_SERVER_PORT=7860
# Expose the port
EXPOSE 7860
# Run the application
CMD ["python", "app.py"]