mynuddin commited on
Commit
9af1d50
·
verified ·
1 Parent(s): d6a4af5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -1
Dockerfile CHANGED
@@ -1,10 +1,18 @@
1
  FROM python:3.9
2
 
 
3
  WORKDIR /app
4
 
 
5
  COPY requirements.txt .
 
6
  RUN pip install -r requirements.txt
7
 
 
 
 
 
8
  COPY app.py .
9
 
10
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.9
2
 
3
+ # Set working directory
4
  WORKDIR /app
5
 
6
+ # Copy requirements and install dependencies
7
  COPY requirements.txt .
8
+ RUN python -m pip install --upgrade pip
9
  RUN pip install -r requirements.txt
10
 
11
+ # Create a writable cache directory for Hugging Face models
12
+ RUN mkdir -p /app/hf_home/ && chmod -R 777 /app/hf_home/
13
+
14
+ # Copy application files
15
  COPY app.py .
16
 
17
+ # Set HF_HOME and run the application
18
+ CMD ["sh", "-c", "export HF_HOME=/app/hf_home && uvicorn app:app --host 0.0.0.0 --port 7860"]