KunalThakare279 commited on
Commit
c5240cd
·
verified ·
1 Parent(s): 0b7385d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -10
Dockerfile CHANGED
@@ -9,24 +9,23 @@ WORKDIR /app
9
  # Copy the application files
10
  COPY . .
11
 
12
- # Create a new cache directory outside of /app
13
- RUN mkdir -p /cache/huggingface && chown -R appuser:appgroup /cache/huggingface
14
 
15
- # Set environment variable to point to the new cache directory
16
- ENV HF_HOME=/cache/huggingface
17
 
18
- # Set the ownership of the entire /app directory and cache directory
19
- RUN chown -R appuser:appgroup /app /cache/huggingface
20
-
21
- # Switch to the non-root user
22
  USER root
23
-
24
  # Install Python dependencies
25
  RUN pip install --no-cache-dir -r requirements.txt
26
 
 
 
 
 
27
  USER appuser
28
 
29
- # Expose the port that the application listens on
30
  EXPOSE 8000
31
 
32
  # Run the application
 
9
  # Copy the application files
10
  COPY . .
11
 
12
+ # Create a temporary cache directory and grant permissions
13
+ RUN mkdir -p /tmp/huggingface && chown -R appuser:appgroup /tmp/huggingface
14
 
15
+ # Set the environment variable to point to the temporary directory
16
+ ENV HF_HOME=/tmp/huggingface
17
 
 
 
 
 
18
  USER root
 
19
  # Install Python dependencies
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
22
+ # Set ownership of the application directory
23
+ RUN chown -R appuser:appgroup /app
24
+
25
+ # Switch to the non-root user
26
  USER appuser
27
 
28
+ # Expose the port
29
  EXPOSE 8000
30
 
31
  # Run the application