added gemini too
Browse files- 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
|
8 |
-
RUN mkdir -p /app/
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
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 |
|