rabiyulfahim commited on
Commit
ad901ae
·
verified ·
1 Parent(s): 8cdef72

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -6
Dockerfile CHANGED
@@ -14,13 +14,22 @@ RUN pip install --no-cache-dir -r requirements.txt
14
  # Copy application code
15
  COPY . .
16
 
17
- # Set environment variables for cache dirs (Docker-friendly)
18
- ENV HF_HOME=/tmp
19
- ENV TRANSFORMERS_CACHE=/tmp
20
- ENV TORCHINDUCTOR_CACHE_DIR=/tmp/torch_inductor_cache
 
 
 
 
 
 
 
21
 
22
- # Create cache folder
23
- RUN mkdir -p /tmp/torch_inductor_cache
 
 
24
 
25
  # Expose port
26
  EXPOSE 7860
 
14
  # Copy application code
15
  COPY . .
16
 
17
+ # # Set environment variables for cache dirs (Docker-friendly)
18
+ # ENV HF_HOME=/tmp
19
+ # ENV TRANSFORMERS_CACHE=/tmp
20
+ # ENV TORCHINDUCTOR_CACHE_DIR=/tmp/torch_inductor_cache
21
+
22
+ # # Create cache folder
23
+ # RUN mkdir -p /tmp/torch_inductor_cache
24
+ # Add a user
25
+ RUN useradd -m -u 1000 appuser
26
+ USER appuser
27
+ WORKDIR /app
28
 
29
+ # Set env variables for torch caches
30
+ ENV TORCH_HOME=/tmp/torch_home
31
+ ENV TORCHINDUCTOR_CACHE_DIR=/tmp/torch_inductor_cache
32
+ RUN mkdir -p /tmp/torch_home /tmp/torch_inductor_cache
33
 
34
  # Expose port
35
  EXPOSE 7860