app / Dockerfile
LONGYKING
deployment fixes
6d17cea
raw
history blame
924 Bytes
# 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 8080
# Run chainlit when the container launches
CMD ["python", "-m", "chainlit", "run", "chatxbt-assistant.py", "--host", "0.0.0.0", "--port", "8080"]