# Use a lightweight Python base image | |
FROM python:3.10-slim | |
# Set environment variables | |
ENV PYTHONDONTWRITEBYTECODE 1 | |
ENV PYTHONUNBUFFERED 1 | |
# Set working directory | |
WORKDIR /code | |
# Copy files | |
COPY . /code/ | |
# Expose port | |
EXPOSE 7860 | |
# Command to run the app | |
CMD ["python", "app.py"] | |
# Install dependencies | |
RUN pip install --upgrade pip | |
RUN pip install -r requirements.txt | |
# Explicitly install huggingface-hub==0.16.4 if not already included in requirements.txt | |
RUN pip install huggingface-hub==0.16.4 | |