Mahmudm commited on
Commit
5f9f9b1
·
verified ·
1 Parent(s): c3e3209

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -4
Dockerfile CHANGED
@@ -1,14 +1,18 @@
1
- FROM python:3.11
2
 
3
  WORKDIR /code
4
 
 
5
  COPY ./requirements.txt /code/requirements.txt
6
  RUN python3 -m pip install --no-cache-dir --upgrade pip
7
  RUN python3 -m pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
 
 
9
  COPY . .
10
 
11
- CMD ["panel", "serve", "/code/app.py", "--address", "0.0.0.0", "--port", "7860", "--allow-websocket-origin", "*", "--num-procs", "2", "--num-threads", "0", "--index", "app"]
 
 
12
 
13
- RUN mkdir /.cache
14
- RUN chmod 777 /.cache
 
1
+ FROM python:3.11-slim
2
 
3
  WORKDIR /code
4
 
5
+ # Install dependencies
6
  COPY ./requirements.txt /code/requirements.txt
7
  RUN python3 -m pip install --no-cache-dir --upgrade pip
8
  RUN python3 -m pip install --no-cache-dir --upgrade -r /code/requirements.txt
9
 
10
+ # Copy the app code
11
  COPY . .
12
 
13
+ # Set permissions if needed (avoid root-level writes)
14
+ RUN mkdir -p /code/.cache && chmod -R 777 /code/.cache
15
+ ENV XDG_CACHE_HOME=/code/.cache
16
 
17
+ # Run the Panel server
18
+ CMD ["panel", "serve", "/code/app.py", "--address", "0.0.0.0", "--port", "7860", "--allow-websocket-origin", "*", "--index", "app"]