Spaces:
Running
Running
oceansweep
commited on
Update Dockerfile
Browse files- Dockerfile +10 -9
Dockerfile
CHANGED
@@ -25,31 +25,32 @@ RUN apt-get update && apt-get install -y \
|
|
25 |
# Create a new user named "user9" with user ID 1009
|
26 |
RUN useradd -m -u 1009 user9
|
27 |
|
28 |
-
# Switch to the "user9" user
|
29 |
-
USER user9
|
30 |
-
|
31 |
# Set environment variables for the user's home directory and PATH
|
32 |
ENV HOME=/home/user9 \
|
33 |
PATH=/home/user9/.local/bin:$PATH
|
34 |
|
35 |
-
#
|
36 |
-
|
|
|
37 |
|
38 |
-
# Clone the repository into the working directory
|
39 |
RUN git clone -b ${BRANCH} ${REPO_URL} .
|
40 |
|
41 |
-
# Set correct ownership for the app directory
|
42 |
RUN chown -R user9:user9 /home/user9/app
|
43 |
|
44 |
-
# Set appropriate permissions for the app directory
|
45 |
RUN chmod -R u+rwX,go+rX,go-w /home/user9/app
|
46 |
|
47 |
# Ensure summarize.py is readable and executable
|
48 |
RUN chmod 755 /home/user9/app/summarize.py
|
49 |
|
|
|
|
|
|
|
50 |
# Create and activate a virtual environment
|
51 |
RUN python3 -m venv venv
|
52 |
-
ENV PATH="
|
53 |
|
54 |
# Upgrade pip and install wheel as the non-root user
|
55 |
RUN pip install --no-cache-dir --upgrade pip wheel
|
|
|
25 |
# Create a new user named "user9" with user ID 1009
|
26 |
RUN useradd -m -u 1009 user9
|
27 |
|
|
|
|
|
|
|
28 |
# Set environment variables for the user's home directory and PATH
|
29 |
ENV HOME=/home/user9 \
|
30 |
PATH=/home/user9/.local/bin:$PATH
|
31 |
|
32 |
+
# Create the app directory and set it as the working directory
|
33 |
+
RUN mkdir -p /home/user9/app
|
34 |
+
WORKDIR /home/user9/app
|
35 |
|
36 |
+
# Clone the repository into the working directory as root
|
37 |
RUN git clone -b ${BRANCH} ${REPO_URL} .
|
38 |
|
39 |
+
# Set correct ownership for the app directory and its contents
|
40 |
RUN chown -R user9:user9 /home/user9/app
|
41 |
|
42 |
+
# Set appropriate permissions for the app directory and its contents
|
43 |
RUN chmod -R u+rwX,go+rX,go-w /home/user9/app
|
44 |
|
45 |
# Ensure summarize.py is readable and executable
|
46 |
RUN chmod 755 /home/user9/app/summarize.py
|
47 |
|
48 |
+
# Switch to the "user9" user
|
49 |
+
USER user9
|
50 |
+
|
51 |
# Create and activate a virtual environment
|
52 |
RUN python3 -m venv venv
|
53 |
+
ENV PATH="/home/user9/app/venv/bin:$PATH"
|
54 |
|
55 |
# Upgrade pip and install wheel as the non-root user
|
56 |
RUN pip install --no-cache-dir --upgrade pip wheel
|