vancyferns commited on
Commit
beec292
·
1 Parent(s): 9d1dd35

updated dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -2
Dockerfile CHANGED
@@ -17,14 +17,20 @@ WORKDIR /app
17
  # Set the DEEPFACE_HOME environment variable to a writable directory
18
  ENV DEEPFACE_HOME=/app
19
 
 
 
 
 
20
  # Copy the requirements file from the 'model' directory
21
- COPY model/requirements.txt .
 
22
 
23
  # Install Python dependencies
24
  RUN pip install --no-cache-dir -r requirements.txt
25
 
26
  # Copy the rest of the 'model' directory's contents
27
- COPY model .
 
28
 
29
  # Expose the port where the Flask API will run
30
  EXPOSE 7860
 
17
  # Set the DEEPFACE_HOME environment variable to a writable directory
18
  ENV DEEPFACE_HOME=/app
19
 
20
+ # Create a non-root user and switch to it for security and permissions
21
+ RUN useradd -m -s /bin/bash appuser
22
+ USER appuser
23
+
24
  # Copy the requirements file from the 'model' directory
25
+ # Use --chown to set the owner to the new user
26
+ COPY --chown=appuser:appuser model/requirements.txt .
27
 
28
  # Install Python dependencies
29
  RUN pip install --no-cache-dir -r requirements.txt
30
 
31
  # Copy the rest of the 'model' directory's contents
32
+ # Use --chown to set the owner to the new user
33
+ COPY --chown=appuser:appuser model .
34
 
35
  # Expose the port where the Flask API will run
36
  EXPOSE 7860