Spaces:
Sleeping
Sleeping
Pedrampedram
commited on
Commit
•
c2cb28f
1
Parent(s):
41f79cd
Update Dockerfile
Browse files- Dockerfile +13 -4
Dockerfile
CHANGED
@@ -1,11 +1,20 @@
|
|
1 |
FROM python:3.9
|
|
|
|
|
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 |
-
|
9 |
-
|
10 |
-
COPY . .
|
11 |
CMD ["chainlit", "run", "app.py", "--port", "7860"]
|
|
|
1 |
FROM python:3.9
|
2 |
+
|
3 |
+
# Create user and set environment variables
|
4 |
RUN useradd -m -u 1000 user
|
|
|
5 |
ENV HOME=/home/user \
|
6 |
PATH=/home/user/.local/bin:$PATH
|
7 |
+
|
8 |
+
# Switch to user and setup working directory
|
9 |
+
USER user
|
10 |
WORKDIR $HOME/app
|
11 |
+
|
12 |
+
# First, copy just the requirements.txt and install dependencies
|
13 |
+
COPY --chown=user ./requirements.txt $HOME/app/requirements.txt
|
14 |
+
RUN pip install --user -r requirements.txt
|
15 |
+
|
16 |
+
# Now copy the rest of the app
|
17 |
COPY --chown=user . $HOME/app
|
18 |
+
|
19 |
+
# Set the default command to run your application
|
|
|
20 |
CMD ["chainlit", "run", "app.py", "--port", "7860"]
|