Spaces:
Runtime error
Runtime error
Commit
·
cc65f9c
1
Parent(s):
56f9f4e
chat pdf Docker file
Browse files- Dockerfile +8 -9
Dockerfile
CHANGED
@@ -1,8 +1,7 @@
|
|
1 |
FROM python:3.11
|
2 |
|
3 |
-
#
|
4 |
RUN useradd -m -u 1000 user
|
5 |
-
USER user
|
6 |
|
7 |
# Set environment variables
|
8 |
ENV HOME=/home/user \
|
@@ -11,15 +10,15 @@ ENV HOME=/home/user \
|
|
11 |
# Set the working directory
|
12 |
WORKDIR $HOME/app
|
13 |
|
14 |
-
#
|
15 |
-
|
16 |
|
17 |
-
#
|
18 |
-
|
19 |
-
|
20 |
|
21 |
# Copy the rest of your application (if needed)
|
22 |
-
COPY . .
|
23 |
|
24 |
# Command to run your application
|
25 |
-
CMD ["
|
|
|
1 |
FROM python:3.11
|
2 |
|
3 |
+
# Create a non-root user
|
4 |
RUN useradd -m -u 1000 user
|
|
|
5 |
|
6 |
# Set environment variables
|
7 |
ENV HOME=/home/user \
|
|
|
10 |
# Set the working directory
|
11 |
WORKDIR $HOME/app
|
12 |
|
13 |
+
# Switch to the non-root user
|
14 |
+
USER user
|
15 |
|
16 |
+
# Clone the Git repository
|
17 |
+
RUN git clone https://github.com/brlrb/chatpdf.git $HOME/app && \
|
18 |
+
pip install --user -r $HOME/app/requirements.txt
|
19 |
|
20 |
# Copy the rest of your application (if needed)
|
21 |
+
COPY --chown=user . .
|
22 |
|
23 |
# Command to run your application
|
24 |
+
CMD ["python", "app.py"]
|