agrosure_resmamba / Dockerfile
agentsay's picture
Update Dockerfile
27a0c45 verified
raw
history blame contribute delete
843 Bytes
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Install system dependencies for OpenCV and other required libraries
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# Create Uploads, cache, and models directories with writable permissions
RUN mkdir -p /app/Uploads /app/cache /app/models && chmod -R 777 /app/Uploads /app/cache /app/models
# Set HF_HOME for huggingface_hub cache
ENV HF_HOME=/app/cache
# Copy all files and folders from the project root to /app
COPY . .
RUN pip install python-multipart
# Install Python dependencies from requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Expose the port for Hugging Face Spaces
EXPOSE 7860
# Command to run the Flask application from app.py
CMD ["python", "app.py"]