etukurudinesh commited on
Commit
53efd5f
·
1 Parent(s): d3a233a

fix: build

Browse files
Files changed (3) hide show
  1. Dockerfile +6 -3
  2. requirements.txt +4 -4
  3. server.py +2 -2
Dockerfile CHANGED
@@ -1,7 +1,7 @@
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
  # Install system dependencies for Playwright
7
  RUN apt-get update && apt-get install -y \
@@ -28,11 +28,14 @@ ENV PATH="/home/user/.local/bin:$PATH"
28
  WORKDIR /app
29
 
30
  COPY --chown=user ./requirements.txt requirements.txt
 
31
  # RUN pip install gradio[mcp] textblob
32
- RUN pip install --no-cache-dir -r requirements.txt
33
 
34
  # Install Playwright browsers
35
- RUN playwright install
 
 
36
 
37
  COPY --chown=user . /app
38
  #CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
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.10-slim
5
 
6
  # Install system dependencies for Playwright
7
  RUN apt-get update && apt-get install -y \
 
28
  WORKDIR /app
29
 
30
  COPY --chown=user ./requirements.txt requirements.txt
31
+
32
  # RUN pip install gradio[mcp] textblob
33
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
34
 
35
  # Install Playwright browsers
36
+ RUN pip install playwright
37
+ RUN playwright install --with-deps
38
+ RUN playwright install firefox
39
 
40
  COPY --chown=user . /app
41
  #CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
requirements.txt CHANGED
@@ -1,6 +1,8 @@
 
 
1
  fastapi==0.104.1
2
  uvicorn==0.24.0
3
- playwright==1.40.0
4
  beautifulsoup4==4.12.2
5
  pymongo==4.6.0
6
  neo4j==5.15.0
@@ -13,6 +15,4 @@ newspaper3k==0.2.8
13
  readability-lxml==0.8.1
14
  python-dotenv==1.0.0
15
  nltk==3.8.1
16
- spacy==3.7.2
17
- gradio[mcp]
18
- textblob
 
1
+ gradio[mcp]
2
+ textblob
3
  fastapi==0.104.1
4
  uvicorn==0.24.0
5
+ #playwright==1.40.0
6
  beautifulsoup4==4.12.2
7
  pymongo==4.6.0
8
  neo4j==5.15.0
 
15
  readability-lxml==0.8.1
16
  python-dotenv==1.0.0
17
  nltk==3.8.1
18
+ spacy==3.7.2
 
 
server.py CHANGED
@@ -31,5 +31,5 @@ with gr.Blocks(title="MCP Web Scraper") as demo:
31
  scrape_button.click(scrape, inputs=url_input, outputs=output)
32
 
33
  if __name__ == "__main__":
34
- demo.launch(server_name="0.0.0.0", server_port=7860)
35
- #demo.launch(mcp_server=True)
 
31
  scrape_button.click(scrape, inputs=url_input, outputs=output)
32
 
33
  if __name__ == "__main__":
34
+ #demo.launch(server_name="0.0.0.0", server_port=7860)
35
+ demo.launch(mcp_server=True, allowed_paths=["/"])