From 198cc1c5825c4b5e2a12367d70c6a342c65069a5 Mon Sep 17 00:00:00 2001 From: Martin Frost Date: Thu, 2 Apr 2026 11:46:35 +0200 Subject: [PATCH 1/3] Upgrade to use Python 3.10 This also restructures the Dockerfile a little bit, to not create some unnecessary layers. Running `COPY ...` and then `RUN chown` as separate lines will create big duplicate layers, when you can do that same thing in one layer with `COPY --chown`. --- Dockerfile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5e42d57..67a0833 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,7 @@ - # # Launch a build container so we do not need to care about junk in the production image # -FROM python:3.8 AS build +FROM python:3.10 AS build # This is needed to start the Django app ARG SECRET_KEY=none @@ -35,21 +34,21 @@ RUN rm db.sqlite3 # # The production container # -FROM python:3.8 +FROM python:3.10 EXPOSE 8080 -COPY --from=build /app /app +RUN adduser --no-create-home --gecos FALSE --disabled-password finger RUN apt-get update \ && apt-get -y install nginx ruby-sass \ && rm -rf /var/lib/apt/lists/* +COPY --from=build --chown=finger /app /app + RUN pip install -r /app/requirements.txt WORKDIR /app -RUN adduser --no-create-home --gecos FALSE --disabled-password finger \ - && sed -i "s/XXX_BUILD_DATE_XXX/`date +'%F %T'`/" /app/fingerweb/settings.py \ - && chown -R finger:finger /app +RUN sed -i "s/XXX_BUILD_DATE_XXX/`date +'%F %T'`/" /app/fingerweb/settings.py ADD conf/nginx.conf /etc/nginx/nginx.conf ADD entrypoint.sh /app/entrypoint.sh From 0c28b31e55dfd3e88e46dfd4ba52fe888f93b62f Mon Sep 17 00:00:00 2001 From: Martin Frost Date: Thu, 2 Apr 2026 11:49:27 +0200 Subject: [PATCH 2/3] Upgrade test workflow --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bcf3c82..d077aa8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.9] + python-version: + - 3.10 steps: - uses: actions/checkout@v2 From b1388669b082993e9a25fe473ff0a51362b04601 Mon Sep 17 00:00:00 2001 From: Martin Frost Date: Thu, 2 Apr 2026 11:50:14 +0200 Subject: [PATCH 3/3] I hate YAML --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d077aa8..ad5e451 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: python-version: - - 3.10 + - "3.10" steps: - uses: actions/checkout@v2