Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +36 -0
Dockerfile
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.9
|
| 2 |
+
|
| 3 |
+
# Install necessary packages
|
| 4 |
+
RUN apt-get update && \
|
| 5 |
+
apt-get install -y \
|
| 6 |
+
bash \
|
| 7 |
+
git git-lfs \
|
| 8 |
+
wget curl procps \
|
| 9 |
+
htop vim nano && \
|
| 10 |
+
rm -rf /var/lib/apt/lists/*
|
| 11 |
+
|
| 12 |
+
# Create a new user
|
| 13 |
+
RUN useradd -m -u 1000 user
|
| 14 |
+
|
| 15 |
+
# Set environment variables
|
| 16 |
+
ENV HOME=/home/user \
|
| 17 |
+
PATH=/home/user/.local/bin:$PATH
|
| 18 |
+
|
| 19 |
+
# Set working directory
|
| 20 |
+
WORKDIR /app
|
| 21 |
+
|
| 22 |
+
# Copy the application files
|
| 23 |
+
COPY ./ /app
|
| 24 |
+
|
| 25 |
+
# Change ownership of the application files
|
| 26 |
+
RUN chown -R user:user /app
|
| 27 |
+
|
| 28 |
+
# Switch to the new user
|
| 29 |
+
USER user
|
| 30 |
+
|
| 31 |
+
# Copy and install Python dependencies
|
| 32 |
+
COPY --chown=user:user requirements.txt $HOME/app/requirements.txt
|
| 33 |
+
RUN pip install --no-cache-dir -r $HOME/app/requirements.txt
|
| 34 |
+
|
| 35 |
+
# Set the command to run the application
|
| 36 |
+
CMD ["chainlit", "run", "chain_app.py", "-w", "--port", "7860" ,"-h"]
|