Skip to content

Commit dc7b948

Browse files
committed
Fix tagui docker image after updates
1 parent 4050762 commit dc7b948

2 files changed

Lines changed: 15 additions & 58 deletions

File tree

OpenFlowNodeRED/Dockerfiletagui

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM node:lts
22
EXPOSE 80
33
EXPOSE 5859
44
RUN apt-get update \
5-
&& apt-get install -y wget gnupg python3-pip python3-venv php \
5+
&& apt-get install -y wget gnupg python3-pip python3-venv php nano sudo \
66
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
77
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
88
&& apt-get update \
@@ -11,37 +11,40 @@ RUN apt-get update \
1111
&& rm -rf /var/lib/apt/lists/*
1212
RUN pip3 install rpa
1313
WORKDIR /data
14-
RUN groupadd -r openiapuser && useradd -r -g openiapuser -G audio,video openiapuser \
14+
RUN groupadd -r openiapuser && useradd -r -g openiapuser -G audio,video,sudo openiapuser \
1515
&& mkdir -p /home/openiapuser/Downloads \
1616
&& chown -R openiapuser:openiapuser /home/openiapuser \
1717
&& chown -R openiapuser:openiapuser /data/
18+
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
1819

19-
# RUN wget -O /tmp/tagui_linux.zip https://github.com/kelaberetiv/TagUI/releases/download/v6.46.0/TagUI_Linux.zip \
20-
# && unzip '/tmp/tagui_linux.zip' -d /home/openiapuser && rm /tmp/tagui_linux.zip || true && mv /home/openiapuser/tagui /home/openiapuser/.tagui && chown -R openiapuser:openiapuser /home/openiapuser
21-
# RUN ln -sf /home/openiapuser/.tagui/src/tagui /usr/local/bin/tagui
22-
20+
# Download and install tagui python, can be be used from python node in node-red
2321
RUN wget -O /tmp/tagui_linux.zip https://github.com/kelaberetiv/TagUI/releases/download/v6.46.0/TagUI_Linux.zip \
2422
&& unzip '/tmp/tagui_linux.zip' -d /home/openiapuser && rm /tmp/tagui_linux.zip || true && chown -R openiapuser:openiapuser /home/openiapuser
2523
RUN ln -sf /home/openiapuser/tagui/src/tagui /usr/local/bin/tagui
2624

27-
# USER openiapuser
28-
25+
# Force tagui python to use headless
2926
ENV search="browser_option = 'chrome'"
3027
ENV replace="browser_option = 'headless'"
31-
# RUN sed -i "s/${search}/${replace}/" /usr/local/lib/python3.5/dist-packages/tagui.py
3228
RUN sed -i "s/${search}/${replace}/" /usr/local/lib/python3.7/dist-packages/tagui.py
3329

30+
# Download and install TagUI ( human language version ) to be used with node-red-contrib-tagui module
3431
RUN wget -O /tmp/tagui_linux2.zip https://github.com/tebelorg/Tump/releases/download/v1.0.0/TagUI_Linux.zip \
3532
&& unzip '/tmp/tagui_linux2.zip' -d /tmp && rm /tmp/tagui_linux2.zip || true && mv /tmp/tagui /home/openiapuser/.tagui && chown -R openiapuser:openiapuser /home/openiapuser/.tagui
3633

37-
# RUN mkdir /home/openiapuser/.tagui && chown -R openiapuser:openiapuser /home/openiapuser/.tagui
38-
# RUN mkdir /home/openiapuser/.tagui_previous && chown -R openiapuser:openiapuser /home/openiapuser/.tagui_previous
39-
# RUN ln -sf /home/openiapuser/tagui /root/tagui
34+
# Force updating to current version
35+
RUN tagui update
36+
# Force tagui to use --no-sandbox parameter from chrome
37+
RUN touch /home/openiapuser/tagui/src/tagui_no_sandbox
4038

4139
COPY --chown=openiapuser:openiapuser docker-package.json ./package.json
4240
RUN npm install --only=prod
4341
COPY --chown=openiapuser:openiapuser dist ./
4442

43+
# work around from https://github.com/bazelbuild/rules_closure/issues/351
44+
# and https://stackoverflow.com/q/53355217/17318661
45+
ENV OPENSSL_CONF=/etc/ssl/
46+
47+
4548
USER openiapuser
4649

4750
ENTRYPOINT ["/usr/local/bin/node", "--inspect=0.0.0.0:5859", "index.js"]

OpenFlowNodeRED/Dockerfiletagui copy

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)