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

feat(Docker): Docker Support #418

Open
wants to merge 9 commits into
base: beta
Choose a base branch
from

Conversation

piechade
Copy link

@piechade piechade commented Jun 10, 2021

So könnte ein Docker Support aussehen.

vaccipy:
    image: vaccipy
    container_name: vaccipy
    restart: always
    environment:
      - VNC_PASSWORD=<password>
      - VNC_PORT=5902
      - WEB_PORT=6902
    ports:
      - 5902:5902
      - 6902:6902
    volumes: 
      - ./vaccipy/kontaktdaten.json/:/app/kontaktdaten.json

Außerdem ist die novnc zwar da, läuft aber nicht. Ich hab es auf die schnelle mit VNC-Viewer gemacht, was keine Lösung ist. Ich hatte zwei bots laufen und musste deshalb die Port config nach außen holen. Ist das eine gute Idee? Lieber alles auf eine Instanz optimieren?

tools/its.py Outdated
@@ -186,6 +186,9 @@ def get_chromedriver(self, headless):

# deaktiviere Selenium Logging
chrome_options.add_argument('disable-infobars')
chrome_options.add_argument("--headless")
chrome_options.add_argument("--no-sandbox")
Copy link
Owner

@timreibe timreibe Jun 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chrome_options.add_argument("--no-sandbox") hatten wir mal und bewusst wieder rausgenommen, um Malware zu vermeiden. Ist das zwingend notwendig für Docker?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eine gute Frage, ich hab das ohne zu hinterfragen immer rein gemacht. Hier ist ein Argument von jemanden anderen.
https://github.com/elgalu/docker-selenium
Docker ist ja eine sandbox und es läuft so und so alles unter root. Ich denke das ist z. B., wenn man unter Windows normal läuft viel wichtiger. Natürlich müsste man eigentlich die Sache etwas modifizieren. Vielleicht einen --docker Parameter der die sandbox reinmacht und ohne Frage die json nimmt.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Headless funktioniert leider nicht. Kann dann maximal zur Terminsuche genutzt werden. Buchung und Code-Gen benötigt eine GUI.

tools/its.py Outdated
@@ -204,7 +207,7 @@ def get_chromedriver(self, headless):

chrome_options.headless = headless

return Chrome(self.get_chromedriver_path(), options=chrome_options)
return Chrome(options=chrome_options)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warum wird der Pfad hier rausgenommen?

Copy link
Author

@piechade piechade Jun 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zeile 16 im Docker File war nicht erfolgreich. Im Docker Container ist der chrome driver schon da und geht ohne den Parameter. Aber ja das muss man besser machen.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hast du die Umgebungsvariable VACCIPY_CHROMEDRIVER verwendet?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hast du die Umgebungsvariable VACCIPY_CHROMEDRIVER verwendet?

Ist ja im Dockerfile prinzipiell drin.

Copy link
Author

@piechade piechade Jun 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jetzt bin ich wieder hier, wenn die Zeile wieder die Methode aufruft.

2021-06-10 13:52:46.857   impfterminservice   [err] [*C4Q2 | 68163, 69124, 69469]   (unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/chromium is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

@timreibe timreibe changed the base branch from master to beta June 10, 2021 11:12
@timreibe timreibe changed the title Docker Support feat(Docker): Docker Support Jun 10, 2021
@piechade piechade force-pushed the master branch 2 times, most recently from ddf112f to 0431731 Compare June 10, 2021 13:23
Dockerfile Show resolved Hide resolved
- 5901:5901
- 6901:6901
volumes:
- ./vaccipy/kontaktdaten.json/:/app/kontaktdaten.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newline am Ende der Datei fehlt

Suggested change
- ./vaccipy/kontaktdaten.json/:/app/kontaktdaten.json
- ./vaccipy/kontaktdaten.json/:/app/kontaktdaten.json

tools/its.py Outdated
@@ -186,6 +186,9 @@ def get_chromedriver(self, headless):

# deaktiviere Selenium Logging
chrome_options.add_argument('disable-infobars')
chrome_options.add_argument("--headless")
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--disable-dev-shm-usage")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was ist das? Ich glaube wir hatten das schon mal aktiviert. Warum wurde es wieder deaktiviert?

@haslersn
Copy link
Contributor

Ich würde vorschlagen, dass wir den PR ablehnen. Wer das mit Docker verwenden will, kann ein out-of-tree Dockerfile maintainen. Wenn wir den PR annehmen, bekommen wir zusätzliche Issues, wenn das Dockerfile nicht mehr funktioniert.

@piechade
Copy link
Author

Ich würde vorschlagen, dass wir den PR ablehnen. Wer das mit Docker verwenden will, kann ein out-of-tree Dockerfile maintainen. Wenn wir den PR annehmen, bekommen wir zusätzliche Issues, wenn das Dockerfile nicht mehr funktioniert.

Bin eigentlich deiner Meinung, hab nur in Slack gesehen, dass Leute Interesse haben. Ich will das auf meinem Server, wo ein Container OS läuft, laufen lassen. Das ist ein sehr persönlicher Fall und ist für den einfachen User nicht zu empfehlen. Falls einer fragt, kann man darauf verweisen.

This was referenced Jun 10, 2021
@piechade piechade force-pushed the feature/docker branch 7 times, most recently from 71f0b1f to 3864649 Compare June 14, 2021 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants