Spaces:
No application file
No application file
Create Docker
Browse files
Docker
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official Python runtime as a parent image
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
+
|
| 4 |
+
# Install system dependencies including a C++ compiler
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
libmupdf-dev \
|
| 7 |
+
gcc \
|
| 8 |
+
g++ \
|
| 9 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
+
|
| 11 |
+
# Set environment variables to ensure the Python output is not buffered
|
| 12 |
+
ENV PYTHONUNBUFFERED=1
|
| 13 |
+
|
| 14 |
+
# Set the correct HOME and PATH variables
|
| 15 |
+
ENV HOME=/home/user \
|
| 16 |
+
PATH=/home/user/.local/bin:$PATH
|
| 17 |
+
|
| 18 |
+
# Create a new non-root user and set permissions
|
| 19 |
+
RUN useradd -m user
|
| 20 |
+
|
| 21 |
+
# Set the working directory in the container
|
| 22 |
+
WORKDIR $HOME/app
|
| 23 |
+
|
| 24 |
+
# Copy the current directory contents into the container's working directory
|
| 25 |
+
COPY . .
|
| 26 |
+
|
| 27 |
+
# Upgrade pip and install any needed packages specified in requirements.txt
|
| 28 |
+
RUN pip install --upgrade pip
|
| 29 |
+
# Upgrade pip and install packages using the legacy resolver
|
| 30 |
+
RUN pip install --default-timeout=1000 --no-cache-dir --use-deprecated=legacy-resolver -r requirements.txt
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
# Expose the port Chainlit runs on (by default Chainlit uses port 8000)
|
| 34 |
+
EXPOSE 8000
|
| 35 |
+
|
| 36 |
+
# Run the app
|
| 37 |
+
CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0"]
|