PhoenixStormJr commited on
Commit
2e08de5
·
verified ·
1 Parent(s): d9ef3c1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -4
Dockerfile CHANGED
@@ -3,17 +3,21 @@
3
  FROM python:3.10-bullseye
4
 
5
  EXPOSE 7860
6
-
7
  WORKDIR /app
8
 
9
  COPY . .
10
 
11
- # Set env vars for matplotlib and numba cache dirs to writable tmp
12
  ENV MPLCONFIGDIR=/tmp/.matplotlib
13
  ENV NUMBA_CACHE_DIR=/tmp/numba_cache
14
 
15
- # Create writable app folders for logging and temp files
16
- RUN mkdir -p /app/logs /app/TEMP && chmod -R 777 /app/logs /app/TEMP
 
 
 
 
 
17
 
18
  RUN pip3 install -r requirements.txt
19
 
 
3
  FROM python:3.10-bullseye
4
 
5
  EXPOSE 7860
 
6
  WORKDIR /app
7
 
8
  COPY . .
9
 
10
+ # Set environment variables for safe caching
11
  ENV MPLCONFIGDIR=/tmp/.matplotlib
12
  ENV NUMBA_CACHE_DIR=/tmp/numba_cache
13
 
14
+ # Make necessary dirs/files writable
15
+ RUN mkdir -p /app/logs /app/TEMP && \
16
+ chmod -R 777 /app/logs /app/TEMP && \
17
+ chmod -R 777 /app/configs
18
+
19
+ # Pre-touch configs/32k.json if it doesn't exist (sometimes COPY sets files to read-only)
20
+ RUN [ ! -f /app/configs/32k.json ] || chmod 666 /app/configs/32k.json
21
 
22
  RUN pip3 install -r requirements.txt
23