ayush2917 commited on
Commit
c551a32
·
verified ·
1 Parent(s): c522ba8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -6
Dockerfile CHANGED
@@ -11,6 +11,12 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
11
  # Set working directory
12
  WORKDIR /app
13
 
 
 
 
 
 
 
14
  # Install system dependencies
15
  RUN apt-get update && apt-get install -y --no-install-recommends \
16
  build-essential \
@@ -34,15 +40,13 @@ RUN python -c "from transformers import AutoModelForCausalLM, AutoTokenizer; Aut
34
  RUN ls -l /app/cache && \
35
  find /app/cache -type f || { echo "Cache verification failed"; exit 1; }
36
 
37
- # Create directories, user, and set permissions
38
- RUN mkdir -p /app/data /app/cache && \
39
- useradd -m myuser && \
40
- chown -R myuser:myuser /app && \
41
- chmod -R u+rw /app/data
42
-
43
  # Copy all project files
44
  COPY . .
45
 
 
 
 
 
46
  # Set non-root user
47
  USER myuser
48
 
 
11
  # Set working directory
12
  WORKDIR /app
13
 
14
+ # Create directories with correct permissions
15
+ RUN mkdir -p /app/data /app/cache && \
16
+ useradd -m myuser && \
17
+ chown -R myuser:myuser /app && \
18
+ chmod -R u+rw /app/data /app/cache
19
+
20
  # Install system dependencies
21
  RUN apt-get update && apt-get install -y --no-install-recommends \
22
  build-essential \
 
40
  RUN ls -l /app/cache && \
41
  find /app/cache -type f || { echo "Cache verification failed"; exit 1; }
42
 
 
 
 
 
 
 
43
  # Copy all project files
44
  COPY . .
45
 
46
+ # Ensure permissions after copy
47
+ RUN chown -R myuser:myuser /app && \
48
+ chmod -R u+rw /app/data /app/cache
49
+
50
  # Set non-root user
51
  USER myuser
52