mckabue commited on
Commit
710deba
·
1 Parent(s): 5d8c9dc

Add Dockerfile for application deployment and clean up import statements in app.py

Browse files
Files changed (2) hide show
  1. Dockerfile +18 -0
  2. app.py +2 -2
Dockerfile ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
+ # you will also find guides on how best to write your Dockerfile
3
+
4
+ FROM python:3.9
5
+
6
+ RUN useradd -m -u 1000 user
7
+
8
+ WORKDIR /app
9
+
10
+ COPY --chown=user ./requirements.txt requirements.txt
11
+
12
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
13
+
14
+ RUN apt-get -y update && apt-get -y install whois && apt-get -y install netbase
15
+
16
+ COPY --chown=user . /app
17
+
18
+ CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import sys
2
  import os
3
 
4
- sys.path.append(os.path.abspath("../../../"))
5
 
6
  import inspect
7
  from typing import Callable, Literal
@@ -10,7 +10,7 @@ import requests
10
  import re
11
  import asyncio
12
  from typing import Any, Callable, Coroutine
13
- from python_utils.get_browser import get_browser_page_async
14
  import re
15
 
16
  app = Quart(__name__)
 
1
  import sys
2
  import os
3
 
4
+ # sys.path.append(os.path.abspath("../../../"))
5
 
6
  import inspect
7
  from typing import Callable, Literal
 
10
  import re
11
  import asyncio
12
  from typing import Any, Callable, Coroutine
13
+ # from python_utils.get_browser import get_browser_page_async
14
  import re
15
 
16
  app = Quart(__name__)