Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Dockerfile and fix Chrome crash #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ dmypy.json

# Project-related
output
app.log
global.json
renderer/inkcheck.html
collectors/trello/config.json
collectors/googlekeep/config.json
collectors/googlekeep/config.json
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM python:latest

RUN apt-get update \
&& apt-get -y install chromium-driver

WORKDIR /inkcheck
COPY ./requirements.txt /inkcheck

RUN pip3 install --no-cache-dir --upgrade -r requirements.txt

COPY . /inkcheck

EXPOSE 8080
ENTRYPOINT ["python3", "main.py"]
3 changes: 3 additions & 0 deletions renderer/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ def take_screenshot(self):
opts.add_argument("--headless")
opts.add_argument("--hide-scrollbars")
opts.add_argument('--force-device-scale-factor=1')
# to avoid chrome crash in docker
opts.add_argument("--disable-dev-shm-usage")
opts.add_argument("--no-sandbox")
driver = webdriver.Chrome(options=opts)
self.set_viewport_size(driver)

Expand Down