durgaprasad143's picture
Upload Dockerfile with huggingface_hub
b496671 verified
raw
history blame contribute delete
550 Bytes
FROM python:3.9
WORKDIR /code
# Copy requirements and install
COPY ./api_requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Install Gunicorn
RUN pip install gunicorn
# Copy the application code
COPY ./flask_api.py /code/flask_api.py
# Create a writable directory for cache (transformers needs this)
RUN mkdir -p /code/cache
ENV TRANSFORMERS_CACHE=/code/cache
RUN chmod 777 /code/cache
# Start the application
CMD ["gunicorn", "-b", "0.0.0.0:7860", "flask_api:app"]