Bikas0's picture
update docker
0eda64e verified
raw
history blame contribute delete
No virus
601 Bytes
FROM python:3.10.0-slim
# Set up the environment
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV HF_HOME=/app/.cache
# Install dependencies
RUN pip install --upgrade pip
# Create and set working directory
WORKDIR /app
# Copy the application code
COPY . /app
# Create a cache directory with appropriate permissions
RUN mkdir -p /app/.cache && chown -R 1000:1000 /app/.cache
# Install the dependencies
RUN pip install -r requirements.txt
# Expose the port and define the entrypoint
EXPOSE 7860
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "2", "--timeout", "120", "app:app"]