From 5b16fff0bd46f2f1d22b98e2356e55bef50e54e8 Mon Sep 17 00:00:00 2001 From: mrbwburns <> Date: Mon, 20 Nov 2023 17:29:46 +0100 Subject: [PATCH] scraper shellscript + dockerfile improvements --- .devcontainer/Dockerfile | 11 +++++++++-- .devcontainer/devcontainer.json | 3 ++- run_weather_scraper.sh | 3 +++ 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100755 run_weather_scraper.sh diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 658ac30..36562fb 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,5 @@ -FROM python:3.9-slim-bullseye -WORKDIR /usr/src/app +FROM python:3.9-slim-bullseye as development +WORKDIR /app RUN apt-get -y update && apt-get install -yqq dos2unix chromium chromium-driver \ libxi6 libgconf-2-4 python3-selenium \ tzdata git @@ -8,3 +8,10 @@ RUN python3 -m pip install --upgrade pip RUN python3 -m pip install --user virtualenv ENV TZ=Europe/Berlin RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +FROM development +COPY ../inkycal/modules/inkycal_openweather_scrape.py /app/ +COPY ./run_weather_scraper.sh /app/ + +# Set the entrypoint to the shell script +ENTRYPOINT ["run_weather_scraper.sh"] \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 121d9bc..a05ecbe 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,8 @@ { "name": "Inkycal-dev", "build": { - "dockerfile": "Dockerfile" + "dockerfile": "Dockerfile", + "target": "development" }, // This is the settings.json mount diff --git a/run_weather_scraper.sh b/run_weather_scraper.sh new file mode 100755 index 0000000..8391faf --- /dev/null +++ b/run_weather_scraper.sh @@ -0,0 +1,3 @@ +#!/bin/sh +python3 /home/ubuntu/Inkycal/inkycal/modules/inkycal_openweather_scrape.py +scp ./openweather_scraped.png inky@10.10.9.10:~/Inkycal/