File size: 909 Bytes
f53da68 aaa8cfe f53da68 1f9439e f53da68 6d17cea 0e14b64 6d17cea aaa8cfe 6d17cea 0e14b64 aaa8cfe 1f9439e f53da68 0e14b64 5ff2d29 f53da68 5ff2d29 |
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 33 34 35 |
# Use an official Python runtime as a parent image
FROM python:3.11-slim
# Create a user and set permissions
RUN useradd -m -u 1000 user
# Set the working directory in the container
WORKDIR /app
# Install system dependencies
USER root
RUN apt-get update && apt-get install -y \
python3-dev \
libpq-dev \
gcc \
&& rm -rf /var/lib/apt/lists/*
# Ensure .files directory exists and is writable
RUN mkdir -p /app/.files && chown -R user:user /app/.files
# Switch back to the non-root user
USER user
# Copy the rest of the application code into the container
COPY --chown=user . .
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Expose port 8080 to the world outside this container
EXPOSE 7860
# Run chainlit when the container launches
CMD ["python", "-m", "chainlit", "run", "chatxbt-assistant.py", "-h", "--port", "7860"]
|