InfosysResponsibleAiToolKit's picture
fairness files
38d6a33
FROM python:3.9
# Create a user to run the app
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
# Set the working directory to root (default is root, no need to set it explicitly)
WORKDIR /
# Copy the requirements.txt file
COPY --chown=user ./requirements/requirements.txt requirements/requirements.txt
# Copy the necessary libraries (if required)
# COPY --chown=user ./lib/aicloudlibs-0.1.0-py3-none-any.whl /lib/
# You can add other .whl files similarly if needed
# COPY --chown=user ./lib/better_profanity-2.0.0-py3-none-any.whl /lib/
# COPY --chown=user ./lib/privacy-1.0.9-py3-none-any.whl /lib/
# Install dependencies
RUN pip install --no-cache-dir --upgrade -r requirements/requirements.txt
# Copy the src folder directly into the root directory
COPY --chown=user ./src /src
COPY --chown=user ./output /output
COPY --chown=user ./lib /lib
COPY --chown=user ./explainability_ai_fairness.egg-info /explainability_ai_fairness.egg-info
COPY --chown=user ./Kubernetes /Kubernetes
COPY --chown=user ./config /config
COPY --chown=user ./models /models
COPY --chown=user ./docs /docs
COPY --chown=user ./requirements /requirements
# Set PYTHONPATH to include /src so Python can find llm_explain
ENV PYTHONPATH="/src:$PYTHONPATH"
RUN pwd
RUN ls
WORKDIR /src
RUN pwd
RUN ls
# Expose the port (default for Hugging Face is 7860)
EXPOSE 7860
# CMD to run the FastAPI app with Uvicorn
CMD ["uvicorn", "main_api:app", "--host", "0.0.0.0", "--port", "7860"]