Update Dockerfile
Browse files- Dockerfile +2 -1
Dockerfile
CHANGED
@@ -43,7 +43,7 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
43 |
# 配置 DrissionPage
|
44 |
RUN cd /usr/local/lib/python3.11/site-packages/DrissionPage/_configs/ && \
|
45 |
sed -i "/browser_path/s/$(grep 'browser_path' 'configs.ini' | awk -F '=' '{print $2}')/\/usr\/bin\/google-chrome-stable/" configs.ini && \
|
46 |
-
sed -i "/arguments/s/\[/\[\'--no-sandbox\', \'--headless=new\', /" configs.ini
|
47 |
|
48 |
# Copy the rest of the application
|
49 |
COPY . .
|
@@ -59,6 +59,7 @@ ENV OPENAI_API_KEY=None
|
|
59 |
ENV ENVIRONMENT="production"
|
60 |
ENV PORT=7860
|
61 |
ENV CHROME_PATH=/usr/bin/google-chrome-stable
|
|
|
62 |
|
63 |
# Command to run the application
|
64 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
43 |
# 配置 DrissionPage
|
44 |
RUN cd /usr/local/lib/python3.11/site-packages/DrissionPage/_configs/ && \
|
45 |
sed -i "/browser_path/s/$(grep 'browser_path' 'configs.ini' | awk -F '=' '{print $2}')/\/usr\/bin\/google-chrome-stable/" configs.ini && \
|
46 |
+
sed -i "/arguments/s/\[/\[\'--no-sandbox\', \'--headless=new\', \'--disable-dev-shm-usage\', \'--disable-gpu\', \'--disable-software-rasterizer\', \'--disable-extensions\', \'--disable-setuid-sandbox\', \'--no-first-run\', \'--no-zygote\', \'--single-process\', \'--remote-debugging-port=9222\', \'--window-size=1920,1080\', \'--user-agent=Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/120.0.0.0 Safari\/537.36\', \'--enable-logging\', \'--v=1\', \'--remote-debugging-address=127.0.0.1\', /" configs.ini
|
47 |
|
48 |
# Copy the rest of the application
|
49 |
COPY . .
|
|
|
59 |
ENV ENVIRONMENT="production"
|
60 |
ENV PORT=7860
|
61 |
ENV CHROME_PATH=/usr/bin/google-chrome-stable
|
62 |
+
ENV CHROME_USER_DATA_DIR=/tmp/chrome-data
|
63 |
|
64 |
# Command to run the application
|
65 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|