promptsai commited on
Commit
431b044
·
verified ·
1 Parent(s): d899e9a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -6
Dockerfile CHANGED
@@ -1,14 +1,16 @@
1
- # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
- # you will also find guides on how best to write your Dockerfile
3
-
4
  # Base image
5
  FROM python:3.9
6
 
7
  # Set the working directory in the container
8
  WORKDIR /code
9
 
10
- # Set an environment variable for Matplotlib cache
11
  ENV MPLCONFIGDIR=/tmp/matplotlib_cache
 
 
 
 
 
12
 
13
  # Install libGL for OpenCV
14
  RUN apt-get update && apt-get install -y \
@@ -28,5 +30,3 @@ COPY . .
28
 
29
  # Command to run the application
30
  CMD ["python", "code/demo.py"]
31
-
32
-
 
 
 
 
1
  # Base image
2
  FROM python:3.9
3
 
4
  # Set the working directory in the container
5
  WORKDIR /code
6
 
7
+ # Set environment variables for writable directories
8
  ENV MPLCONFIGDIR=/tmp/matplotlib_cache
9
+ ENV XDG_CACHE_HOME=/tmp/cache
10
+
11
+ # Create the directories and ensure permissions
12
+ RUN mkdir -p /tmp/cache \
13
+ && chmod -R 777 /tmp
14
 
15
  # Install libGL for OpenCV
16
  RUN apt-get update && apt-get install -y \
 
30
 
31
  # Command to run the application
32
  CMD ["python", "code/demo.py"]