Soumik555 commited on
Commit
ec0e22d
·
1 Parent(s): c9feee8

removed trailing from post

Browse files
Files changed (2) hide show
  1. Dockerfile +3 -0
  2. controller.py +3 -0
Dockerfile CHANGED
@@ -4,6 +4,9 @@ FROM python:3.11-slim
4
  # Set the working directory inside the container
5
  WORKDIR /app
6
 
 
 
 
7
  # Copy the requirements file first
8
  COPY requirements.txt .
9
 
 
4
  # Set the working directory inside the container
5
  WORKDIR /app
6
 
7
+ # Create the cache directory and set permissions
8
+ RUN mkdir -p /app/cache && chmod -R 777 /app/cache
9
+
10
  # Copy the requirements file first
11
  COPY requirements.txt .
12
 
controller.py CHANGED
@@ -33,6 +33,9 @@ matplotlib.use('Agg')
33
  # Initialize FastAPI app
34
  app = FastAPI()
35
 
 
 
 
36
  load_dotenv()
37
 
38
  image_file_path = os.getenv("IMAGE_FILE_PATH")
 
33
  # Initialize FastAPI app
34
  app = FastAPI()
35
 
36
+ # Ensure the cache directory exists
37
+ os.makedirs("/app/cache", exist_ok=True)
38
+
39
  load_dotenv()
40
 
41
  image_file_path = os.getenv("IMAGE_FILE_PATH")