KunalThakare279 commited on
Commit
bf08545
·
verified ·
1 Parent(s): b522915

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -8
Dockerfile CHANGED
@@ -9,22 +9,22 @@ WORKDIR /app
9
  # Copy the application files
10
  COPY . .
11
 
12
- # Change ownership of the application files
13
- RUN chown -R appuser:appgroup /app
14
 
15
- # Set environment variable to point to a cache directory inside /app
16
  ENV HF_HOME=/app/.cache/huggingface
17
 
18
- # Switch to the non-root user
19
  USER root
20
 
21
  # Install Python dependencies
22
- RUN python -m pip install --no-cache-dir -r requirements.txt
23
 
24
- # Switch back to root to add commands that need root access
25
- USER root
26
 
27
- RUN apt-get update && apt-get install -y git
 
28
 
29
  # Expose the port that the application listens on
30
  EXPOSE 8000
 
9
  # Copy the application files
10
  COPY . .
11
 
12
+ # Create the .cache directory inside /app and set permissions
13
+ RUN mkdir -p /app/.cache/huggingface && chown -R appuser:appgroup /app/.cache
14
 
15
+ # Set environment variable to point to the cache directory
16
  ENV HF_HOME=/app/.cache/huggingface
17
 
 
18
  USER root
19
 
20
  # Install Python dependencies
21
+ RUN pip install --no-cache-dir -r requirements.txt
22
 
23
+ # Set the ownership of the entire /app directory
24
+ RUN chown -R appuser:appgroup /app
25
 
26
+ # Switch to the non-root user
27
+ USER appuser
28
 
29
  # Expose the port that the application listens on
30
  EXPOSE 8000