TKU410410103 commited on
Commit
abeb8cb
1 Parent(s): c08ad6c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -11
Dockerfile CHANGED
@@ -20,15 +20,17 @@ RUN git clone https://github.com/reazon-research/ReazonSpeech /app/ReazonSpeech
20
  RUN pip install --no-warn-conflicts /app/ReazonSpeech/pkg/nemo-asr
21
  RUN pip install /app/ReazonSpeech/pkg/nemo-asr
22
 
23
- # Create directories for the model and transformers' cache
24
- RUN mkdir -p /app/cache/huggingface /app/cache/modelscope
25
-
26
- # Ensure the directory is writable by any user (useful if running as a non-root user)
27
- RUN chmod -R 777 /app/cache
28
 
29
  # Set environment variables for cache directories
30
  ENV TRANSFORMERS_CACHE=/app/cache/huggingface
 
31
  ENV MODELSCOPE_CACHE=/app/cache/modelscope
 
 
 
32
 
33
  # Copy the rest of the application source code
34
  COPY . /app
@@ -41,10 +43,5 @@ ENV MODULE_NAME="app.main"
41
  ENV VARIABLE_NAME="app"
42
  ENV PORT=7860
43
 
44
- # Optionally, run as a non-root user
45
- # Create a user 'appuser' and switch to it. Uncomment the next two lines if needed
46
- # RUN useradd -m appuser
47
- # USER appuser
48
-
49
  # Run the app using Uvicorn
50
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
20
  RUN pip install --no-warn-conflicts /app/ReazonSpeech/pkg/nemo-asr
21
  RUN pip install /app/ReazonSpeech/pkg/nemo-asr
22
 
23
+ # Create directories for caches and set permissions
24
+ RUN mkdir -p /app/cache/huggingface /app/cache/modelscope /app/cache/matplotlib /app/cache/fontconfig /app/cache/lhotse && \
25
+ chmod -R 777 /app/cache
 
 
26
 
27
  # Set environment variables for cache directories
28
  ENV TRANSFORMERS_CACHE=/app/cache/huggingface
29
+ ENV HF_HOME=/app/cache/huggingface
30
  ENV MODELSCOPE_CACHE=/app/cache/modelscope
31
+ ENV MPLCONFIGDIR=/app/cache/matplotlib
32
+ ENV FONTCONFIG_PATH=/app/cache/fontconfig
33
+ ENV LHOTSE_CACHE=/app/cache/lhotse
34
 
35
  # Copy the rest of the application source code
36
  COPY . /app
 
43
  ENV VARIABLE_NAME="app"
44
  ENV PORT=7860
45
 
 
 
 
 
 
46
  # Run the app using Uvicorn
47
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", 7860]