athmontech commited on
Commit
4131431
Β·
1 Parent(s): ef69efc

Fix cache directory permissions: use /tmp instead of /app/cache

Browse files
Files changed (2) hide show
  1. Dockerfile +3 -3
  2. start.sh +4 -5
Dockerfile CHANGED
@@ -29,11 +29,11 @@ COPY . .
29
  # Make startup script executable
30
  RUN chmod +x start.sh
31
 
32
- # Create cache directory for models with proper permissions
33
- RUN mkdir -p /app/cache && chmod 777 /app/cache
34
 
35
  # Set environment variables
36
- ENV HF_HOME=/app/cache
37
  ENV PYTHONPATH=/app
38
  ENV NUMBA_CACHE_DIR=/tmp/numba_cache
39
  ENV NUMBA_DISABLE_JIT=1
 
29
  # Make startup script executable
30
  RUN chmod +x start.sh
31
 
32
+ # Create cache directories with proper permissions
33
+ RUN mkdir -p /tmp/hf_cache /tmp/numba_cache && chmod 777 /tmp/hf_cache /tmp/numba_cache
34
 
35
  # Set environment variables
36
+ ENV HF_HOME=/tmp/hf_cache
37
  ENV PYTHONPATH=/app
38
  ENV NUMBA_CACHE_DIR=/tmp/numba_cache
39
  ENV NUMBA_DISABLE_JIT=1
start.sh CHANGED
@@ -1,5 +1,5 @@
1
  #!/bin/bash
2
- set -e
3
 
4
  echo "πŸš€ Starting Carsa AI Backend..."
5
  echo "πŸ“ Working directory: $(pwd)"
@@ -30,12 +30,11 @@ except ImportError as e:
30
  "
31
 
32
  # Create cache directories with proper permissions
33
- mkdir -p /app/cache /tmp/numba_cache
34
- chmod 777 /app/cache /tmp/numba_cache
35
- echo "πŸ“ Cache directories created with proper permissions"
36
 
37
  # Set environment variables
38
- export HF_HOME=/app/cache
39
  export PYTHONPATH=/app
40
  export NUMBA_CACHE_DIR=/tmp/numba_cache
41
  export NUMBA_DISABLE_JIT=1
 
1
  #!/bin/bash
2
+ # Don't exit on errors - we'll handle them gracefully
3
 
4
  echo "πŸš€ Starting Carsa AI Backend..."
5
  echo "πŸ“ Working directory: $(pwd)"
 
30
  "
31
 
32
  # Create cache directories with proper permissions
33
+ mkdir -p /tmp/hf_cache /tmp/numba_cache
34
+ echo "πŸ“ Cache directories ready: /tmp/hf_cache, /tmp/numba_cache"
 
35
 
36
  # Set environment variables
37
+ export HF_HOME=/tmp/hf_cache
38
  export PYTHONPATH=/app
39
  export NUMBA_CACHE_DIR=/tmp/numba_cache
40
  export NUMBA_DISABLE_JIT=1