haiyizxx commited on
Commit
cd8212e
·
1 Parent(s): bf0c1ca

fix: pre-install deps in Docker, skip runtime pip install

Browse files
Files changed (3) hide show
  1. Dockerfile +1 -0
  2. app.py +0 -4
  3. requirements.txt +6 -0
Dockerfile CHANGED
@@ -8,4 +8,5 @@ RUN pip install --no-cache-dir -r requirements.txt
8
 
9
  COPY app.py .
10
 
 
11
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
8
 
9
  COPY app.py .
10
 
11
+ EXPOSE 7860
12
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
app.py CHANGED
@@ -28,10 +28,6 @@ def _clone_repo(workdir: Path) -> Path:
28
  ["git", "clone", "--depth", "1", "-b", REPO_REF, repo_url, str(repo_dir)],
29
  check=True,
30
  )
31
- subprocess.run(
32
- [sys.executable, "-m", "pip", "install", "-q", "-r", str(repo_dir / "requirements.txt")],
33
- check=True,
34
- )
35
  return repo_dir
36
 
37
 
 
28
  ["git", "clone", "--depth", "1", "-b", REPO_REF, repo_url, str(repo_dir)],
29
  check=True,
30
  )
 
 
 
 
31
  return repo_dir
32
 
33
 
requirements.txt CHANGED
@@ -1,2 +1,8 @@
1
  fastapi
2
  uvicorn[standard]
 
 
 
 
 
 
 
1
  fastapi
2
  uvicorn[standard]
3
+ requests
4
+ numpy
5
+ Pillow
6
+ datasets
7
+ huggingface_hub
8
+ tqdm