Commit
·
4cc679b
1
Parent(s):
58c9745
update
Browse files- Dockerfile +2 -20
- app.py +3 -3
Dockerfile
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
-
FROM python:3.
|
2 |
|
3 |
# Install system dependencies
|
4 |
RUN apt -qq update && \
|
5 |
apt -qq install -y --no-install-recommends \
|
6 |
curl \
|
|
|
7 |
git \
|
8 |
gnupg2 \
|
9 |
unzip \
|
@@ -35,20 +36,6 @@ RUN apt -qq update && \
|
|
35 |
&& apt-get clean && \
|
36 |
rm -rf /var/lib/apt/lists/
|
37 |
|
38 |
-
# Install Chrome
|
39 |
-
RUN mkdir -p /tmp/ && \
|
40 |
-
cd /tmp/ && \
|
41 |
-
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
|
42 |
-
dpkg -i ./google-chrome-stable_current_amd64.deb || apt-get install -fqqy && \
|
43 |
-
rm ./google-chrome-stable_current_amd64.deb
|
44 |
-
|
45 |
-
# Install Chromedriver
|
46 |
-
RUN mkdir -p /tmp/ && \
|
47 |
-
cd /tmp/ && \
|
48 |
-
wget -O chromedriver.zip https://chromedriver.storage.googleapis.com/$(curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE)/chromedriver_linux64.zip && \
|
49 |
-
unzip -o chromedriver.zip chromedriver -d /usr/bin/ && \
|
50 |
-
chmod +x /usr/bin/chromedriver && \
|
51 |
-
rm chromedriver.zip
|
52 |
|
53 |
# Create user with UID 1000
|
54 |
RUN useradd -m -u 1000 user
|
@@ -56,8 +43,6 @@ RUN useradd -m -u 1000 user
|
|
56 |
# Set environment variables
|
57 |
ENV HOME=/home/user \
|
58 |
PATH=/home/user/.local/bin:$PATH \
|
59 |
-
CHROME_DRIVER=/usr/bin/chromedriver \
|
60 |
-
CHROME_BIN=/usr/bin/google-chrome-stable \
|
61 |
PYTHONUNBUFFERED=1 \
|
62 |
PIP_CACHE_DIR=/home/user/.cache/pip
|
63 |
|
@@ -78,7 +63,4 @@ RUN pip install --upgrade pip \
|
|
78 |
# Copy application code
|
79 |
COPY --chown=user . .
|
80 |
|
81 |
-
# Verification commands
|
82 |
-
RUN google-chrome --version && chromedriver --version
|
83 |
-
|
84 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
+
FROM python:3.11.11-bullseye
|
2 |
|
3 |
# Install system dependencies
|
4 |
RUN apt -qq update && \
|
5 |
apt -qq install -y --no-install-recommends \
|
6 |
curl \
|
7 |
+
ca-certificates \
|
8 |
git \
|
9 |
gnupg2 \
|
10 |
unzip \
|
|
|
36 |
&& apt-get clean && \
|
37 |
rm -rf /var/lib/apt/lists/
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
# Create user with UID 1000
|
41 |
RUN useradd -m -u 1000 user
|
|
|
43 |
# Set environment variables
|
44 |
ENV HOME=/home/user \
|
45 |
PATH=/home/user/.local/bin:$PATH \
|
|
|
|
|
46 |
PYTHONUNBUFFERED=1 \
|
47 |
PIP_CACHE_DIR=/home/user/.cache/pip
|
48 |
|
|
|
63 |
# Copy application code
|
64 |
COPY --chown=user . .
|
65 |
|
|
|
|
|
|
|
66 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
app.py
CHANGED
@@ -7,7 +7,7 @@ from itertools import islice
|
|
7 |
from typing import Dict, Any, Optional
|
8 |
from fastapi.middleware.cors import CORSMiddleware
|
9 |
from xnxx_api import search_filters
|
10 |
-
from xnxx_api
|
11 |
|
12 |
# Constants
|
13 |
CREATOR = "EyePatch"
|
@@ -155,9 +155,9 @@ async def xnxx_search(
|
|
155 |
"url": x.url,
|
156 |
"author": x.author,
|
157 |
"length": x.length,
|
158 |
-
"highest_quality": x.highest_quality,
|
159 |
"publish_date": x.publish_date,
|
160 |
-
"views": x.views,
|
161 |
"thumb": x.thumbnail_url[0] if isinstance(x.thumbnail_url, list) and len(x.thumbnail_url) > 0 else None
|
162 |
})
|
163 |
return SuccessResponse(
|
|
|
7 |
from typing import Dict, Any, Optional
|
8 |
from fastapi.middleware.cors import CORSMiddleware
|
9 |
from xnxx_api import search_filters
|
10 |
+
from xnxx_api import Client as xnxx_client
|
11 |
|
12 |
# Constants
|
13 |
CREATOR = "EyePatch"
|
|
|
155 |
"url": x.url,
|
156 |
"author": x.author,
|
157 |
"length": x.length,
|
158 |
+
# "highest_quality": x.highest_quality,
|
159 |
"publish_date": x.publish_date,
|
160 |
+
# "views": x.views,
|
161 |
"thumb": x.thumbnail_url[0] if isinstance(x.thumbnail_url, list) and len(x.thumbnail_url) > 0 else None
|
162 |
})
|
163 |
return SuccessResponse(
|