From 0ccb6521f4ea403d4c4912fe6bf2afe24cf8e62d Mon Sep 17 00:00:00 2001 From: TheRealDanii <58031079+TheRealDanii@users.noreply.github.com> Date: Wed, 4 Nov 2026 13:25:35 +0100 Subject: [PATCH] fix(kubernetes_engine): replace deprecated base image in django_tutorial Dockerfile --- kubernetes_engine/django_tutorial/Dockerfile | 31 ++++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/kubernetes_engine/django_tutorial/Dockerfile b/kubernetes_engine/django_tutorial/Dockerfile index b5be9702786..b8eb7191533 100644 --- a/kubernetes_engine/django_tutorial/Dockerfile +++ b/kubernetes_engine/django_tutorial/Dockerfile @@ -11,19 +11,24 @@ # See the License for the specific language governing permissions and # limitations under the License. -# The Google App Engine python runtime is Debian Jessie with Python installed -# and various os-level packages to allow installation of popular Python -# libraries. The source is on github at: -# https://github.com/GoogleCloudPlatform/python-docker -FROM gcr.io/google_appengine/python +# Use the official lightweight Python image. +# https://hub.docker.com/_/python +FROM python:3.14-slim -# Create a virtualenv for the application dependencies. -# # If you want to use Python 2, use the -p python2.7 flag. -RUN virtualenv -p python3 /env -ENV PATH /env/bin:$PATH +# Allow statements and log messages to immediately appear in the logs +ENV PYTHONUNBUFFERED True -ADD requirements.txt /app/requirements.txt -RUN /env/bin/pip install --upgrade pip && /env/bin/pip install -r /app/requirements.txt -ADD . /app +# polls.yaml expects the container to listen on port 8080. +ENV PORT 8080 -CMD gunicorn -b :$PORT mysite.wsgi +ENV APP_HOME /app +WORKDIR $APP_HOME + +# Install dependencies first to take advantage of layer caching. +COPY requirements.txt ./ +RUN pip install --no-cache-dir -r requirements.txt + +# Copy local code to the container image. +COPY . ./ + +CMD exec gunicorn --bind :$PORT mysite.wsgi