wallpaint / Dockerfile.local
aliroohan179's picture
Update Dockerfile.local
b77c12d verified
FROM python:3.10-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
libgomp1 \
wget \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements
COPY requirements.txt .
# Install Python dependencies with GPU support
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY main.py .
# Download SAM model (using vit_h for best quality in local development)
# Comment out if you want to mount the model from host
RUN wget -q https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth || \
echo "Warning: Could not download SAM model. App will run with fallback methods."
# Expose port 8000 for local development
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD python -c "import requests; requests.get('http://localhost:8000/health')" || exit 1
# Run the application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]