SIH-Crop-Yield-API / Dockerfile
AshrafGalibSk's picture
Upload folder using huggingface_hub
bbd5f9c verified
Raw
History Blame Contribute Delete
660 Bytes
FROM python:3.9-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
g++ \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Create models directory (ensure it exists)
RUN mkdir -p models
# Expose port (Hugging Face Spaces typically uses 7860)
EXPOSE 7860
# Set environment variable for Hugging Face Spaces
ENV PORT=7860
# Run the application (using app.py for Hugging Face Spaces)
CMD ["python3", "app.py"]