api_rag / Dockerfile
Zamax14's picture
Adding permissions to all folders
f9b3bae
Raw History Blame Contribute Delete
1.39 kB
# ==============================================================================
# Project Name: RAG LLM
# Script Name: Dockerfile
# Authors: Abraham Sánchez, Ulises Moya, Alejandro Zarate
# Description:
# This Python application provides an API service that retrieves answers to
# user queries based on the given context.
#
# License: MIT
# ==============================================================================
FROM python:3.12.8-slim
LABEL "author"="IIEG - Instituto de Información Estadística y Geografíca de Jalisco"
RUN apt update && \
apt install --no-install-recommends -y \
curl \
libmagic-dev \
ffmpeg \
libsm6 \
libxext6 \
&& apt clean \
&& apt autoremove \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /api
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN pip install -U -q --no-cache-dir pip wheel
RUN pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
COPY rag/requirements.txt .
RUN pip install -r requirements.txt
ADD rag/app/ /api/app/
ADD rag/models/ /api/models/
ADD rag/taggers/ /api/taggers/
ADD rag/tokenizers/ /api/tokenizers/
RUN mkdir -p /api/rag/models/hub
RUN chmod -R 777 /api
EXPOSE 7860
CMD ["hypercorn", "app.main:app", "--bind", "0.0.0.0:7860", "--access-logfile", "-"]