Abdurrehman015 commited on
Commit
11406d1
·
1 Parent(s): b438270

firstCommit5

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -8
Dockerfile CHANGED
@@ -7,7 +7,7 @@ RUN apt-get update && apt-get install -y \
7
  libglib2.0-0 \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
- # Install pip + dependencies
11
  COPY requirements.txt .
12
  RUN pip install --upgrade pip
13
  RUN pip install --no-cache-dir -r requirements.txt
@@ -15,15 +15,16 @@ RUN pip install --no-cache-dir -r requirements.txt
15
  # Copy app code
16
  COPY main.py .
17
 
18
- # Create a writable cache folder for Hugging Face
19
- RUN mkdir -p /app/cache
20
- ENV TRANSFORMERS_CACHE=/app/cache
21
 
22
- # Optionally expose a port (if not auto-detected)
23
- EXPOSE 8000
24
 
25
- # Hugging Face token if needed
26
  ENV HF_TOKEN=$HF_TOKEN
27
 
28
- # Run the app
 
 
29
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
 
7
  libglib2.0-0 \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
+ # Install dependencies
11
  COPY requirements.txt .
12
  RUN pip install --upgrade pip
13
  RUN pip install --no-cache-dir -r requirements.txt
 
15
  # Copy app code
16
  COPY main.py .
17
 
18
+ # Make writable cache folder
19
+ RUN mkdir -p /app/hf_cache
 
20
 
21
+ # Set correct environment variable
22
+ ENV HF_HOME=/app/hf_cache
23
 
24
+ # If you're passing HF_TOKEN via platform settings, keep this:
25
  ENV HF_TOKEN=$HF_TOKEN
26
 
27
+ EXPOSE 8000
28
+
29
+ # Run your app (change main:app if needed)
30
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]