|
FROM python:3.10-slim |
|
|
|
ENV PYTHONDONTWRITEBYTECODE 1 |
|
|
|
ENV PYTHONUNBUFFERED 1 |
|
|
|
|
|
ENV ENVIRONMENT=dev |
|
|
|
COPY ./app /app |
|
COPY requirements.txt . |
|
WORKDIR . |
|
RUN mkdir -p data |
|
RUN mkdir -p assets/data |
|
|
|
RUN apt-get update && apt-get install -y \ |
|
unzip \ |
|
curl \ |
|
wget \ |
|
git git-lfs \ |
|
bash \ |
|
&& rm -rf /var/lib/apt/lists/*2 |
|
|
|
|
|
RUN mkdir -p /nltk_data |
|
RUN chmod -R 777 /nltk_data |
|
|
|
RUN chmod -R 777 /usr/local/lib/python3.10/site-packages/llama_index/legacy/_static/nltk_cache |
|
RUN mkdir -p /.cache |
|
RUN chmod -R 777 /.cache |
|
|
|
ENV TRANSFORMERS_CACHE=/usr/local/lib/python3.10/site-packages/llama_index/legacy/_static/nltk_cache |
|
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir --upgrade -r app/requirements.txt |
|
|
|
RUN pip install --no-cache-dir --upgrade -r requirements.txt |
|
|
|
|
|
|
|
RUN --mount=type=secret,id=GUARDRAILS_TOKEN,mode=0444,required=true \ |
|
guardrails configure --token $(cat /run/secrets/GUARDRAILS_TOKEN) --no-metrics True |
|
RUN guardrails hub install hub://guardrails/regex_match |
|
RUN guardrails hub install hub://guardrails/toxic_language |
|
RUN guardrails hub install hub://guardrails/detect_pii |
|
RUN guardrails hub install hub://guardrails/qa_relevance_llm_eval |
|
|
|
|
|
CMD ["uvicorn", "app.main_reflex:app", "--host", "0.0.0.0", "--port", "7860"] |