From eb5fb46d616d5fdad5de63e0f89d16b6177500d6 Mon Sep 17 00:00:00 2001 From: "Alex Ellis (OpenFaaS Ltd)" Date: Tue, 16 Jul 2024 11:43:17 +0100 Subject: [PATCH] Update of-watchdog to 0.10.4 and Python to 3.12 Signed-off-by: Alex Ellis (OpenFaaS Ltd) --- README.md | 2 +- template/python27-flask/Dockerfile | 6 +++--- template/python3-flask-debian/Dockerfile | 10 +++++----- template/python3-flask/Dockerfile | 10 +++++----- template/python3-http-debian/Dockerfile | 10 +++++----- template/python3-http/Dockerfile | 10 +++++----- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 68c5221..7e2f3fe 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Are you referencing pip modules which require a native build toolchain? It's adv ## Python Versioning We try to keep the default Python 3 version up-to-date, however, you can specify a specific python version using the `PYTHON_VERSION` build argument. -The current stable version of python is 3.11, you might want to test the next pre-release using +The current stable version of Python is 3.12, you might want to test the next pre-release using: ```yaml functions: diff --git a/template/python27-flask/Dockerfile b/template/python27-flask/Dockerfile index 0c61bc1..db84c5b 100644 --- a/template/python27-flask/Dockerfile +++ b/template/python27-flask/Dockerfile @@ -1,5 +1,5 @@ -FROM ghcr.io/openfaas/of-watchdog:0.10.1 as watchdog -FROM python:2.7-alpine as build +FROM ghcr.io/openfaas/of-watchdog:0.10.4 AS watchdog +FROM python:2.7-alpine AS build COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog RUN chmod +x /usr/bin/fwatchdog @@ -36,7 +36,7 @@ USER root COPY --chown=app:app function function USER app -FROM build as ship +FROM build AS ship ENV fprocess="python index.py" ENV cgi_headers="true" diff --git a/template/python3-flask-debian/Dockerfile b/template/python3-flask-debian/Dockerfile index e62165c..9c685cb 100644 --- a/template/python3-flask-debian/Dockerfile +++ b/template/python3-flask-debian/Dockerfile @@ -1,6 +1,6 @@ -ARG PYTHON_VERSION=3.11 -FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.10.1 as watchdog -FROM --platform=${TARGETPLATFORM:-linux/amd64} python:${PYTHON_VERSION}-slim-buster as build +ARG PYTHON_VERSION=3.12 +FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.10.4 AS watchdog +FROM --platform=${TARGETPLATFORM:-linux/amd64} python:${PYTHON_VERSION}-slim-buster AS build COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog RUN chmod +x /usr/bin/fwatchdog @@ -42,13 +42,13 @@ USER root COPY --chown=app:app function/ . -FROM build as test +FROM build AS test ARG TEST_COMMAND=tox ARG TEST_ENABLED=true RUN [ "$TEST_ENABLED" = "false" ] && echo "skipping tests" || eval "$TEST_COMMAND" -FROM build as ship +FROM build AS ship WORKDIR /home/app/ #configure WSGI server and healthcheck diff --git a/template/python3-flask/Dockerfile b/template/python3-flask/Dockerfile index 384577c..e60eede 100644 --- a/template/python3-flask/Dockerfile +++ b/template/python3-flask/Dockerfile @@ -1,6 +1,6 @@ -ARG PYTHON_VERSION=3.11 -FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.10.1 as watchdog -FROM --platform=${TARGETPLATFORM:-linux/amd64} python:${PYTHON_VERSION}-alpine as build +ARG PYTHON_VERSION=3.12 +FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.10.4 AS watchdog +FROM --platform=${TARGETPLATFORM:-linux/amd64} python:${PYTHON_VERSION}-alpine AS build COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog RUN chmod +x /usr/bin/fwatchdog @@ -41,12 +41,12 @@ USER root COPY --chown=app:app function/ . -FROM build as test +FROM build AS test ARG TEST_COMMAND=tox ARG TEST_ENABLED=true RUN [ "$TEST_ENABLED" = "false" ] && echo "skipping tests" || eval "$TEST_COMMAND" -FROM build as ship +FROM build AS ship WORKDIR /home/app/ #configure WSGI server and healthcheck diff --git a/template/python3-http-debian/Dockerfile b/template/python3-http-debian/Dockerfile index d446ad7..73bdb54 100644 --- a/template/python3-http-debian/Dockerfile +++ b/template/python3-http-debian/Dockerfile @@ -1,6 +1,6 @@ -ARG PYTHON_VERSION=3.11 -FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.10.1 as watchdog -FROM --platform=${TARGETPLATFORM:-linux/amd64} python:${PYTHON_VERSION}-slim-buster as build +ARG PYTHON_VERSION=3.12 +FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.10.4 AS watchdog +FROM --platform=${TARGETPLATFORM:-linux/amd64} python:${PYTHON_VERSION}-slim-buster AS build COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog RUN chmod +x /usr/bin/fwatchdog @@ -37,14 +37,14 @@ RUN pip install --no-cache-dir --user -r requirements.txt USER root COPY --chown=app:app function/ . -FROM build as test +FROM build AS test ARG TEST_COMMAND=tox ARG TEST_ENABLED=true RUN [ "$TEST_ENABLED" = "false" ] && echo "skipping tests" || eval "$TEST_COMMAND" -FROM build as ship +FROM build AS ship WORKDIR /home/app/ USER app diff --git a/template/python3-http/Dockerfile b/template/python3-http/Dockerfile index 13c4e42..605e86f 100644 --- a/template/python3-http/Dockerfile +++ b/template/python3-http/Dockerfile @@ -1,6 +1,6 @@ -ARG PYTHON_VERSION=3.11 -FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.10.1 as watchdog -FROM --platform=${TARGETPLATFORM:-linux/amd64} python:${PYTHON_VERSION}-alpine as build +ARG PYTHON_VERSION=3.12 +FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.10.4 AS watchdog +FROM --platform=${TARGETPLATFORM:-linux/amd64} python:${PYTHON_VERSION}-alpine AS build COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog RUN chmod +x /usr/bin/fwatchdog @@ -38,12 +38,12 @@ RUN pip install --no-cache-dir --user -r requirements.txt USER root COPY --chown=app:app function/ . -FROM build as test +FROM build AS test ARG TEST_COMMAND=tox ARG TEST_ENABLED=true RUN [ "$TEST_ENABLED" = "false" ] && echo "skipping tests" || eval "$TEST_COMMAND" -FROM build as ship +FROM build AS ship WORKDIR /home/app/ # configure WSGI server and healthcheck