Damien Benveniste commited on
Commit
be09c5e
·
1 Parent(s): fd3ed35
Files changed (1) hide show
  1. Dockerfile +12 -7
Dockerfile CHANGED
@@ -1,13 +1,7 @@
1
  FROM python:3.9
2
 
 
3
  RUN useradd -m -u 1000 user
4
- USER user
5
- ENV PATH="/home/user/.local/bin:$PATH"
6
-
7
- # Install system dependencies
8
- # RUN apt-get update && apt-get install -y \
9
- # build-essential \
10
- # && rm -rf /var/lib/apt/lists/*
11
 
12
  # Set the working directory in the container
13
  WORKDIR /app
@@ -17,7 +11,18 @@ RUN pip install --no-cache-dir vllm
17
 
18
  # Copy the entrypoint script
19
  COPY entrypoint.sh /app/entrypoint.sh
 
 
 
 
 
20
  RUN chmod +x /app/entrypoint.sh
21
 
 
 
 
 
 
 
22
  # Set the entrypoint
23
  ENTRYPOINT ["/app/entrypoint.sh"]
 
1
  FROM python:3.9
2
 
3
+ # Create a non-root user
4
  RUN useradd -m -u 1000 user
 
 
 
 
 
 
 
5
 
6
  # Set the working directory in the container
7
  WORKDIR /app
 
11
 
12
  # Copy the entrypoint script
13
  COPY entrypoint.sh /app/entrypoint.sh
14
+
15
+ # Change ownership of the working directory and entrypoint script to the non-root user
16
+ RUN chown -R user:user /app
17
+
18
+ # Change permissions of the entrypoint script
19
  RUN chmod +x /app/entrypoint.sh
20
 
21
+ # Switch to the non-root user
22
+ USER user
23
+
24
+ # Set the PATH for the non-root user
25
+ ENV PATH="/home/user/.local/bin:$PATH"
26
+
27
  # Set the entrypoint
28
  ENTRYPOINT ["/app/entrypoint.sh"]