omaryasserhassan commited on
Commit
7d74338
·
verified ·
1 Parent(s): 04c30fa

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -12
Dockerfile CHANGED
@@ -1,27 +1,20 @@
1
- # Use a small Python base
2
  FROM python:3.11-slim
3
 
4
- # System deps (curl only for quick debugging if needed)
5
- RUN apt-get update && apt-get install -y --no-install-recommends \
6
- curl \
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
- # Set persistent cache location for Docker Spaces
 
 
 
10
  ENV HF_HOME=/data/hf_cache
11
  ENV HUGGINGFACE_HUB_CACHE=/data/hf_cache
12
 
13
- # App dir
14
  WORKDIR /app
15
-
16
- # Dependencies
17
  COPY requirements.txt /app/requirements.txt
18
  RUN pip install --no-cache-dir -r requirements.txt
19
 
20
- # App code
21
  COPY app.py /app/app.py
22
 
23
- # Expose Space port
24
  EXPOSE 7860
25
-
26
- # Start the API
27
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.11-slim
2
 
3
+ RUN apt-get update && apt-get install -y --no-install-recommends curl \
 
 
4
  && rm -rf /var/lib/apt/lists/*
5
 
6
+ # Create and open permissions on /data for the runtime user
7
+ RUN mkdir -p /data/hf_cache && chmod -R 777 /data
8
+
9
+ # Cache envs for hf_hub / ctransformers
10
  ENV HF_HOME=/data/hf_cache
11
  ENV HUGGINGFACE_HUB_CACHE=/data/hf_cache
12
 
 
13
  WORKDIR /app
 
 
14
  COPY requirements.txt /app/requirements.txt
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
 
17
  COPY app.py /app/app.py
18
 
 
19
  EXPOSE 7860
 
 
20
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]