plarnholt commited on
Commit
b12d382
·
verified ·
1 Parent(s): d133f37

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -6
Dockerfile CHANGED
@@ -1,22 +1,24 @@
1
  FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04
2
-
3
  ENV DEBIAN_FRONTEND=noninteractive \
4
  PYTHONUNBUFFERED=1 \
5
  PIP_NO_CACHE_DIR=1 \
6
- HF_HUB_ENABLE_HF_TRANSFER=1
 
 
 
 
7
 
8
- # System deps
9
  RUN apt-get update && apt-get install -y python3 python3-pip git && rm -rf /var/lib/apt/lists/*
10
-
11
  WORKDIR /app
12
 
13
  COPY requirements.txt /app/
14
  RUN python3 -m pip install --upgrade pip && pip3 install -r requirements.txt
15
 
 
 
 
16
  COPY app.py /app/
17
 
18
- # HF Spaces expects the app to bind $PORT (we’ll default to 7860)
19
  ENV PORT=7860
20
  EXPOSE 7860
21
-
22
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04
 
2
  ENV DEBIAN_FRONTEND=noninteractive \
3
  PYTHONUNBUFFERED=1 \
4
  PIP_NO_CACHE_DIR=1 \
5
+ HF_HUB_ENABLE_HF_TRANSFER=1 \
6
+ NUMBA_CACHE_DIR=/tmp/numba_cache \
7
+ # optional: uncomment to fully disable FS caching
8
+ # NUMBA_DISABLE_FILE_SYSTEM_CACHING=1
9
+ OUTLINES_CACHE_DIR=/tmp/outlines_cache
10
 
 
11
  RUN apt-get update && apt-get install -y python3 python3-pip git && rm -rf /var/lib/apt/lists/*
 
12
  WORKDIR /app
13
 
14
  COPY requirements.txt /app/
15
  RUN python3 -m pip install --upgrade pip && pip3 install -r requirements.txt
16
 
17
+ # ensure cache dirs exist & writable
18
+ RUN mkdir -p /tmp/numba_cache /tmp/outlines_cache && chmod -R 777 /tmp/numba_cache /tmp/outlines_cache
19
+
20
  COPY app.py /app/
21
 
 
22
  ENV PORT=7860
23
  EXPOSE 7860
 
24
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]