summarize-articles / Dockerfile
yashxx07's picture
Update Dockerfile
10c440f verified
raw
history blame
598 Bytes
FROM python:3.9
WORKDIR /code
RUN --mount=type=secret,id=huggingface_token,mode=0444,required=true \
git init && \
git remote add origin $(cat /run/secrets/huggingface_token)
# Set the TRANSFORMERS_CACHE environment variable
ENV TRANSFORMERS_CACHE=/tmp/.cache/huggingface
# Create the cache folder with appropriate permissions
RUN mkdir -p $TRANSFORMERS_CACHE && chmod -R 777 $TRANSFORMERS_CACHE
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
COPY . .
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]