srivatsavdamaraju commited on
Commit
fcd6a9a
1 Parent(s): 3f83a7b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -8
Dockerfile CHANGED
@@ -5,8 +5,8 @@ FROM python:3.9-slim
5
  ENV PYTHONDONTWRITEBYTECODE 1
6
  ENV PYTHONUNBUFFERED 1
7
 
8
- # Step 3: Disable torch hub cache and set the cache directory
9
- ENV TORCH_HOME=/.cache
10
  ENV TORCH_HUB_NO_CACHE=1
11
 
12
  # Step 4: Install system dependencies
@@ -21,17 +21,20 @@ RUN apt-get update && apt-get install -y \
21
  # Step 5: Set the working directory inside the container
22
  WORKDIR /app
23
 
24
- # Step 6: Copy the requirements file into the container
 
 
 
25
  COPY requirements.txt /app/
26
 
27
- # Step 7: Install the Python dependencies
28
  RUN pip install --no-cache-dir -r requirements.txt
29
 
30
- # Step 8: Copy the rest of the application files into the container
31
- COPY . /
32
 
33
- # Step 9: Expose the port that the Flask app will run on
34
  EXPOSE 5000
35
 
36
- # Step 10: Set the entry point to start the Flask application
37
  CMD ["python", "app.py"]
 
5
  ENV PYTHONDONTWRITEBYTECODE 1
6
  ENV PYTHONUNBUFFERED 1
7
 
8
+ # Step 3: Set environment variables for torch cache directory and disable caching
9
+ ENV TORCH_HOME=/app/.cache
10
  ENV TORCH_HUB_NO_CACHE=1
11
 
12
  # Step 4: Install system dependencies
 
21
  # Step 5: Set the working directory inside the container
22
  WORKDIR /app
23
 
24
+ # Step 6: Create the cache directory and ensure it's writable
25
+ RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
26
+
27
+ # Step 7: Copy the requirements file into the container
28
  COPY requirements.txt /app/
29
 
30
+ # Step 8: Install the Python dependencies
31
  RUN pip install --no-cache-dir -r requirements.txt
32
 
33
+ # Step 9: Copy the rest of the application files into the container
34
+ COPY . /app/
35
 
36
+ # Step 10: Expose the port that the Flask app will run on
37
  EXPOSE 5000
38
 
39
+ # Step 11: Set the entry point to start the Flask application
40
  CMD ["python", "app.py"]