Spaces:
Runtime error
Runtime error
Upload Dockerfile
Browse files- Dockerfile +30 -0
Dockerfile
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use the official Python image from the Docker Hub
|
2 |
+
FROM python:3.9
|
3 |
+
|
4 |
+
# Create a user with the UID 1000
|
5 |
+
RUN useradd -m -u 1000 user
|
6 |
+
|
7 |
+
# Switch to the user
|
8 |
+
USER user
|
9 |
+
|
10 |
+
# Set environment variables
|
11 |
+
ENV HOME=/home/user \
|
12 |
+
PATH=/home/user/.local/bin:$PATH
|
13 |
+
|
14 |
+
# Create the app directory
|
15 |
+
WORKDIR $HOME/app
|
16 |
+
|
17 |
+
# Copy requirements file first to leverage Docker cache
|
18 |
+
COPY --chown=user requirements.txt .
|
19 |
+
|
20 |
+
# Update pip, setuptools, and wheel
|
21 |
+
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
|
22 |
+
|
23 |
+
# Install dependencies
|
24 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
25 |
+
|
26 |
+
# Copy the rest of the application code
|
27 |
+
COPY --chown=user . .
|
28 |
+
|
29 |
+
# Set the entrypoint
|
30 |
+
ENTRYPOINT ["chainlit", "run", "app.py", "--port", "7860"]
|