Skip to content

fix(kubernetes_engine): replace deprecated base image in django_tutorial Dockerfile - #14757

Open
TheRealDanii wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
TheRealDanii:fix-django-tutorial-dockerfile
Open

TheRealDanii wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
TheRealDanii:fix-django-tutorial-dockerfile

Conversation

@TheRealDanii

@TheRealDanii TheRealDanii commented Nov 4, 2026 •

Copy link
Copy Markdown

Description

The kubernetes_engine/django_tutorial Dockerfile still builds on gcr.io/google_appengine/python, which is no longer maintained and ships Python 3.7 or older. requirements.txt only installs Django when python_version >= "3.12", so in that image Django is never installed and gunicorn fails to load mysite.wsgi.

This replaces it with python:3.14-slim, the same base image as the run/ samples. The container still listens on port 8080 (which polls.yaml expects) and runs the same gunicorn mysite.wsgi command. The virtualenv is dropped because the official image doesn't need one.

How I tested (locally with podman, not on a live GKE cluster):

  • podman build succeeds
  • podman run --rm <img> python -c "import django, gunicorn, psycopg2" works and reports Django 6.1.1
  • podman run with the default CMD: gunicorn boots and listens on 0.0.0.0:8080

Checklist

Testing

  • I have tested this change on a live environment and verified it works as intended.

Compliance & Style


Post-Approval Actions

  • Please merge this PR for me once it is approved

@TheRealDanii
TheRealDanii requested review from a team as code owners November 4, 2026 12:25
@product-auto-label product-auto-label Bot added samples Issues that are directly related to samples. api: container Issues related to the Kubernetes Engine API API. labels Nov 4, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Dockerfile for the Django tutorial in the Kubernetes Engine directory. It replaces the deprecated Google App Engine Python base image with the official python:3.14-slim image, configures environment variables for unbuffered logging and the default port, optimizes the build process by leveraging layer caching for dependencies, and uses exec to run Gunicorn. There are no review comments to address, and the changes look solid and follow modern Docker best practices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: container Issues related to the Kubernetes Engine API API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant