File size: 1,034 Bytes
2371911 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# Use the official Python image as base
FROM python:3.9-slim
# Create a non-root user
RUN useradd -m -u 1000 user
# Set the working directory in the container
WORKDIR /app
# Install system dependencies
RUN apt-get update && \
apt-get install -y gcc python3-dev python3-venv && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Copy requirements file
COPY --chown=user ./requirements.txt requirements.txt
# Install dependencies
RUN python3 -m venv env && \
/bin/bash -c "source env/bin/activate && pip install --no-cache-dir --upgrade -r requirements.txt" && \
/bin/bash -c "source env/bin/activate && pip install chainlit langchain_community"
# Make port 7680 available to the world outside the container
EXPOSE 7680
# Copy the application code into the container
COPY --chown=user . /app
# Run the application
CMD ["/bin/bash", "-c", "source env/bin/activate && uvicorn app:app --host 0.0.0.0 --port 7680 && python3 downloadLLM.py && python3 ingest.py && chainlit run app.py --host 0.0.0.0 --port 7680"]
|