Dockerfile to chromium

This commit is contained in:
Jordan Poles
2021-08-08 07:30:14 +00:00
committed by GitHub
parent c54cd6898d
commit 78488260d1
2 changed files with 4 additions and 17 deletions
+3 -16
View File
@@ -4,22 +4,9 @@ USER root
RUN apt-get update && apt-get upgrade -yq RUN apt-get update && apt-get upgrade -yq
RUN apt-get install python3 python3-pip jq nano -y RUN apt-get install python3 python3-pip jq nano -y
# Install chrome and dependencies # Install chromium
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y chromium
apt-transport-https \ RUN ln -s /usr/bin/chromium /usr/bin/chromium-browser
ca-certificates \
curl \
gnupg \
--no-install-recommends \
&& curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list \
&& apt-get update && apt-get install -y \
google-chrome-stable \
--no-install-recommends
# Chrome won't run from the root user.
RUN groupadd chrome && useradd -g chrome -s /bin/bash -G audio,video chrome \
&& mkdir -p /home/chrome && chown -R chrome:chrome /home/chrome
COPY requirements.txt . COPY requirements.txt .
RUN pip3 install -r requirements.txt RUN pip3 install -r requirements.txt
+1 -1
View File
@@ -13,7 +13,7 @@ meter = Meter(
account_uuid=os.getenv("ACCOUNT_UUID"), account_uuid=os.getenv("ACCOUNT_UUID"),
meter_number=os.getenv("METER_NUMBER"), meter_number=os.getenv("METER_NUMBER"),
site=os.getenv("SITE"), site=os.getenv("SITE"),
browser_path="/usr/bin/google-chrome-stable" browser_path="/usr/bin/chromium-browser"
) )
startTime, endTime, value, uom = asyncio.get_event_loop().run_until_complete(meter.last_read()) startTime, endTime, value, uom = asyncio.get_event_loop().run_until_complete(meter.last_read())