Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Add Docker Support
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliusJacobitz authored and Dennis Piecha committed Jun 10, 2021
1 parent 77d81c7 commit 0431731
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM debian:buster

# install apt dependencies
RUN apt-get update -y
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y locales chromium=90.0.4430.212-1~deb10u1 chromium-driver=90.0.4430.212-1~deb10u1 python3 python3-pip python-websockify git xorg vnc4server autocutsel lxde-core novnc
RUN pip3 install --upgrade pip

RUN sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=de_DE.UTF-8

ENV LANG de_DE.UTF-8

WORKDIR /app

ENV VACCIPY_CHROMEDRIVER="/usr/bin/chromedriver"

# copy whole folder into container
COPY . .

RUN pip3 install -r requirements.txt

# setup vnc
RUN echo "# XScreenSaver Preferences File\nmode: off\nselected: -1" > /root/.xscreensaver && \
cat /root/.xscreensaver && mkdir /root/.vnc/ && \
echo "#!/bin/sh\n/usr/bin/autocutsel -s CLIPBOARD -fork\nxrdb $HOME/.Xresources\nxsetroot -solid grey\n#x-terminal-emulator -geometry 80x24+10+10 -ls -title \"$VNCDESKTOP Desktop\" &\n#x-window-manager &\n# Fix to make GNOME work\nexport XKL_XMODMAP_DISABLE=1\n/etc/X11/Xsession &\nx-terminal-emulator -e \"python3 /app/main.py search -f /app/kontaktdaten.json 2>&1 | tee /app/vaccipy\"" > /root/.vnc/xstartup && \
chmod +x /root/.vnc/xstartup && \
cat /root/.vnc/xstartup && \
mv /usr/share/novnc/vnc.html /usr/share/novnc/index.html && \
echo "#!/bin/bash\nsetxkbmap -option lv3:rwin_switch\necho -n \${VNC_PASSWORD:-vaccipy} | vncpasswd -f > /root/.vnc/passwd\nchmod 400 ~/.vnc/passwd\n\nexport USER=root\nvncserver -localhost no :1 -geometry 1920x1080 -depth 24 -rfbport \${VNC_PORT:-5901} && websockify -D --web=/usr/share/novnc/ \${WEB_PORT:-6901} localhost:\${VNC_PORT:-5901} \ntail -f /app/vaccipy" > /root/vnc-startup.sh && \
chmod +x /root/vnc-startup.sh && \
cat /root/vnc-startup.sh && \
chmod go-rwx /root/.vnc

CMD ["/root/vnc-startup.sh"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ werden (von uns oder euch - feel free!) irgendwann hinzukommen:

- [ ] Datum eingrenzen bei der Terminwahl
- [ ] Github Pages
- [ ] Integrierter updater.
- [ ] Macosx Build / Pipeline (Mac currently blocks the app: [Branch](https://github.com/iamnotturner/vaccipy/tree/mac-intel-build))
- [ ] Code Zertifikate für Windows (gegen Virusmeldung)

Expand Down
5 changes: 4 additions & 1 deletion tools/its.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
chrome_options.add_experimental_option('useAutomationExtension', False)
chrome_options.add_experimental_option("excludeSwitches", ["enable-automation"])
chrome_options.add_experimental_option('excludeSwitches', ['enable-logging'])
Expand All @@ -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)

def driver_enter_code(self, driver, plz_impfzentrum):
"""
Expand Down

0 comments on commit 0431731

Please sign in to comment.