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