Game4all commited on
Commit
4635b74
·
1 Parent(s): 8dcc49f

Fix wrong python executbale

Browse files
Files changed (3) hide show
  1. Dockerfile +6 -37
  2. README.md +1 -0
  3. app.py +6 -1
Dockerfile CHANGED
@@ -2,48 +2,17 @@ FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
 
5
- RUN apt-get update && apt-get install -y \
6
- wget \
7
- gnupg \
8
- ca-certificates \
9
- fonts-liberation \
10
- libasound2 \
11
- libatk-bridge2.0-0 \
12
- libatk1.0-0 \
13
- libc6 \
14
- libcairo2 \
15
- libcups2 \
16
- libdbus-1-3 \
17
- libexpat1 \
18
- libfontconfig1 \
19
- libgcc1 \
20
- libglib2.0-0 \
21
- libgtk-3-0 \
22
- libnspr4 \
23
- libnss3 \
24
- libx11-6 \
25
- libx11-xcb1 \
26
- libxcb1 \
27
- libxcomposite1 \
28
- libxcursor1 \
29
- libxdamage1 \
30
- libxext6 \
31
- libxfixes3 \
32
- libxi6 \
33
- libxrandr2 \
34
- libxrender1 \
35
- libxss1 \
36
- libxtst6 \
37
- xdg-utils \
38
- && apt-get clean && rm -rf /var/lib/apt/lists/*
39
-
40
  COPY requirements.txt .
41
  RUN pip install --no-cache-dir -r requirements.txt
42
 
43
- RUN playwright install chromium
 
 
 
 
44
 
45
  COPY . .
46
 
47
  EXPOSE 7860
48
 
49
- CMD ["python3" "./app.py"]
 
2
 
3
  WORKDIR /app
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  COPY requirements.txt .
6
  RUN pip install --no-cache-dir -r requirements.txt
7
 
8
+ ENV PLAYWRIGHT_BROWSERS_PATH=0
9
+
10
+ RUN pip install --no-cache-dir playwright && \
11
+ playwright install-deps chromium && \
12
+ playwright install chromium
13
 
14
  COPY . .
15
 
16
  EXPOSE 7860
17
 
18
+ CMD ["python", "./app.py"]
README.md CHANGED
@@ -5,6 +5,7 @@ colorFrom: green
5
  colorTo: yellow
6
  sdk: docker
7
  app_port: 7860
 
8
  ---
9
 
10
 
 
5
  colorTo: yellow
6
  sdk: docker
7
  app_port: 7860
8
+ short_description: A SERP scrapping API for AI projects
9
  ---
10
 
11
 
app.py CHANGED
@@ -124,6 +124,11 @@ async def query_google_scholar(params: APISearchParams):
124
  return {"error": "Unimplemented"}
125
 
126
 
 
 
 
 
 
127
  @app.post("/search_patents")
128
  async def search_patents(params: APISearchParams) -> APIPatentResults:
129
  """Searches google patents for the specified queries and returns the found documents."""
@@ -153,4 +158,4 @@ async def search_brave(params: APISearchParams) -> APIBraveResults:
153
 
154
  return APIBraveResults(results=results, error=None)
155
 
156
- uvicorn.run(app, port=7860)
 
124
  return {"error": "Unimplemented"}
125
 
126
 
127
+ @app.get('/')
128
+ async def status():
129
+ return {"status": "running"}
130
+
131
+
132
  @app.post("/search_patents")
133
  async def search_patents(params: APISearchParams) -> APIPatentResults:
134
  """Searches google patents for the specified queries and returns the found documents."""
 
158
 
159
  return APIBraveResults(results=results, error=None)
160
 
161
+ uvicorn.run(app, host="0.0.0.0", port=7860)