Soumik555 commited on
Commit
d48dd7a
·
1 Parent(s): 3c9eeaf

added gemini too

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -13
Dockerfile CHANGED
@@ -4,19 +4,21 @@ FROM python:3.11-slim
4
  # Set the working directory inside the container
5
  WORKDIR /app
6
 
7
- # Create the generated_charts directory and set permissions
8
- RUN mkdir -p /app/generated_charts && chmod -R 777 /app/generated_charts
9
-
10
- # Create the cache directory and set permissions
11
- RUN mkdir -p /app/cache && chmod -R 777 /app/cache
12
-
13
- # Create the log file and set permissions
14
- RUN touch /app/pandasai.log && chmod 666 /app/pandasai.log
15
-
16
- # Create the log file and set permissions
17
- RUN touch /app/api_key_rotation.log && chmod 666 /app/api_key_rotation.log
18
-
19
- # Set the Matplotlib cache directory to /app/cache
 
 
20
  ENV MPLCONFIGDIR=/app/cache
21
 
22
  # Copy the requirements file first
@@ -28,6 +30,10 @@ RUN pip install --no-cache-dir -r requirements.txt
28
  # Copy the rest of the application code
29
  COPY . .
30
 
 
 
 
 
31
  # Expose port 7860 (required by Hugging Face Spaces)
32
  EXPOSE 7860
33
 
 
4
  # Set the working directory inside the container
5
  WORKDIR /app
6
 
7
+ # Create all required directories with proper permissions upfront
8
+ RUN mkdir -p /app/generated_outputs && \
9
+ mkdir -p /app/generated_charts && \
10
+ mkdir -p /app/cache && \
11
+ chmod -R 777 /app/generated_outputs && \
12
+ chmod -R 777 /app/generated_charts && \
13
+ chmod -R 777 /app/cache
14
+
15
+ # Create log files with proper permissions
16
+ RUN touch /app/pandasai.log && \
17
+ touch /app/api_key_rotation.log && \
18
+ chmod 666 /app/pandasai.log && \
19
+ chmod 666 /app/api_key_rotation.log
20
+
21
+ # Set environment variables
22
  ENV MPLCONFIGDIR=/app/cache
23
 
24
  # Copy the requirements file first
 
30
  # Copy the rest of the application code
31
  COPY . .
32
 
33
+ # Ensure the user has write permissions to all directories
34
+ RUN chown -R 1000:1000 /app && \
35
+ chmod -R 777 /app
36
+
37
  # Expose port 7860 (required by Hugging Face Spaces)
38
  EXPOSE 7860
39