From ddbb1bceb8dde4d509f0d23a0fa79adb6c1d8ba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Sch=C3=BCtte?= Date: Sat, 8 Jun 2024 12:38:00 +0200 Subject: [PATCH 1/3] Update base image to python:3.12 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 617ac21..7e9993c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9-slim-buster +FROM python:3.12-slim WORKDIR /app From a041583ec9ed1c1ed018eb6479265a6bf31fa671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Sch=C3=BCtte?= Date: Sat, 8 Jun 2024 12:55:39 +0200 Subject: [PATCH 2/3] Create dependabot.yml --- .github/dependabot.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..eee3bbb --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "monthly" + - package-ecosystem: "docker" + directory: "/" + schedule: + interval: "monthly" From f47f00d45a2106ebd4e05193c67091428c11e304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Sch=C3=BCtte?= Date: Sat, 8 Jun 2024 13:18:52 +0200 Subject: [PATCH 3/3] ci: improve Dockerfile, remove pip/python cache files, run as non-root user --- Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7e9993c..5417045 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,9 +5,13 @@ WORKDIR /app RUN apt-get update && apt-get install -y shellcheck \ && rm -rf /var/lib/apt/lists/* +# prevent 9Mb of cached bytecode files (.pyc) +ENV PYTHONDONTWRITEBYTECODE=1 + COPY requirements.txt requirements.txt -RUN pip3 install -r requirements.txt +RUN pip3 install --no-compile --no-cache-dir -r requirements.txt -COPY . . +COPY yaml_shellcheck.py . +USER 1000 ENTRYPOINT [ "python3", "yaml_shellcheck.py"]