dbmoradi60 commited on
Commit
2ff2b3c
·
verified ·
1 Parent(s): 1ed64c5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -3
Dockerfile CHANGED
@@ -1,3 +1,4 @@
 
1
  FROM python:3.10-slim
2
 
3
  # Install system dependencies
@@ -11,6 +12,13 @@ RUN apt-get update && apt-get install -y \
11
  # Set working directory
12
  WORKDIR /app
13
 
 
 
 
 
 
 
 
14
  # Copy requirements file
15
  COPY requirements.txt .
16
 
@@ -20,11 +28,11 @@ RUN pip install --no-cache-dir -r requirements.txt
20
  # Copy application code
21
  COPY . .
22
 
 
 
 
23
  # Expose port for the API
24
  EXPOSE 8000
25
 
26
- # Download model weights
27
- RUN huggingface-cli download openai/gpt-oss-20b --include "original/*" --local-dir /app/gpt-oss-20b
28
-
29
  # Command to run the application
30
  CMD ["python", "app.py"]
 
1
+
2
  FROM python:3.10-slim
3
 
4
  # Install system dependencies
 
12
  # Set working directory
13
  WORKDIR /app
14
 
15
+ # Create a cache directory with proper permissions
16
+ RUN mkdir -p /app/cache/huggingface && chmod -R 777 /app/cache
17
+
18
+ # Set environment variables for Hugging Face cache
19
+ ENV HF_HOME=/app/cache/huggingface
20
+ ENV HUGGINGFACE_HUB_CACHE=/app/cache/huggingface/hub
21
+
22
  # Copy requirements file
23
  COPY requirements.txt .
24
 
 
28
  # Copy application code
29
  COPY . .
30
 
31
+ # Download model weights during build (optional, if disk space allows)
32
+ RUN huggingface-cli download openai/gpt-oss-20b --include "original/*" --local-dir /app/gpt-oss-20b || true
33
+
34
  # Expose port for the API
35
  EXPOSE 8000
36
 
 
 
 
37
  # Command to run the application
38
  CMD ["python", "app.py"]