File size: 605 Bytes
13e8440 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
FROM python:3.9
ENV HF_HOME=/hf
WORKDIR /code
RUN chmod -R 777 /code
RUN mkdir -p /hf && chmod -R 777 /hf
RUN mkdir -p /code/client-data && chmod -R 777 /code/client-data
COPY ./requirements.txt /code/requirements.txt
COPY ./main.py /code/main.py
# Expose the secret SECRET_EXAMPLE at buildtime and use its value as git remote URL
RUN --mount=type=secret,id=FILE_URL,mode=0444,required=true \
curl -o /code/util.py $(cat /run/secrets/FILE_URL)
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |