Spaces:
Sleeping
Sleeping
| 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 ./requirement.txt requirement.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 requirement.txt | |
| # Copy the src folder directly into the root directory | |
| COPY --chown=user ./src /src | |
| COPY --chown=user ./config /config | |
| COPY --chown=user ./models /models | |
| COPY --chown=user ./lib /lib | |
| # Set PYTHONPATH to include /src so Python can find llm_explain | |
| ENV PYTHONPATH="/src:$PYTHONPATH" | |
| # Expose the port (default for Hugging Face is 7860) | |
| EXPOSE 7860 | |
| # CMD to run the FastAPI app with Uvicorn | |
| CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "7860"] | |