Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +4 -23
Dockerfile
CHANGED
@@ -1,30 +1,11 @@
|
|
1 |
-
# Use Python 3.11 as base image
|
2 |
FROM python:3.11
|
3 |
-
|
4 |
-
# Add a non-root user for security reasons
|
5 |
RUN useradd -m -u 1000 user
|
6 |
-
|
7 |
-
# Switch to the new user
|
8 |
USER user
|
9 |
-
|
10 |
-
# Set environment variables
|
11 |
ENV HOME=/home/user \
|
12 |
PATH=/home/user/.local/bin:$PATH
|
13 |
-
|
14 |
-
# Set the working directory
|
15 |
WORKDIR $HOME/app
|
16 |
-
|
17 |
-
# Copy the requirements file first to leverage Docker caching
|
18 |
-
COPY --chown=user requirements.txt $HOME/app/requirements.txt
|
19 |
-
|
20 |
-
# Uninstall any versions of Pydantic to prevent conflict, and then install 1.10.19
|
21 |
-
RUN pip uninstall -y pydantic && pip install --no-cache-dir pydantic==1.10.19
|
22 |
-
|
23 |
-
# Install the rest of the dependencies from requirements.txt
|
24 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
25 |
-
|
26 |
-
# Copy the rest of the application files
|
27 |
COPY --chown=user . $HOME/app
|
28 |
-
|
29 |
-
|
30 |
-
|
|
|
|
|
|
1 |
FROM python:3.11
|
|
|
|
|
2 |
RUN useradd -m -u 1000 user
|
|
|
|
|
3 |
USER user
|
|
|
|
|
4 |
ENV HOME=/home/user \
|
5 |
PATH=/home/user/.local/bin:$PATH
|
|
|
|
|
6 |
WORKDIR $HOME/app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
COPY --chown=user . $HOME/app
|
8 |
+
COPY ./requirements.txt ~/app/requirements.txt
|
9 |
+
RUN pip install -r requirements.txt
|
10 |
+
COPY . .
|
11 |
+
CMD ["chainlit", "run", "app.py", "--port", "7860"]
|