Skip to content

Comments

fix: replace distroless Python 3.11 base with python:3.12-slim and add CI smoke test#17

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/fix-production-image-test
Draft

fix: replace distroless Python 3.11 base with python:3.12-slim and add CI smoke test#17
Copilot wants to merge 3 commits intomainfrom
copilot/fix-production-image-test

Conversation

Copy link
Contributor

Copilot AI commented Feb 10, 2026

Production image crashes on startup because gcr.io/distroless/python3-debian12:nonroot ships Python 3.11.2 while the backend builder compiles against Python 3.12. Native extensions (pydantic_core._pydantic_core) fail to load.

ModuleNotFoundError: No module named 'pydantic_core._pydantic_core'

Dockerfile

  • Replace distroless base with python:3.12-slim, matching the builder stage Python version
  • Copy the full .venv and activate via PATH instead of manually setting PYTHONPATH to a version-specific site-packages path
  • Add non-root user (chronowarden, uid 1000) and HEALTHCHECK instruction
  • Install curl + ca-certificates for health checks

CI smoke test (docker.yaml)

  • Build production image with load: true before any push
  • Start the container and poll /api/v1/health for up to 30 seconds
  • Fail the workflow if the health endpoint never responds, with verbose curl output and container logs for diagnostics
  • Multi-platform build+push steps gated behind github.event_name != 'pull_request'
Original prompt

Fix production image. Just try to run it after building it, this will fail. The CI should have some kind of smoke test to just run and see if health endpoints on the backend are responding. Fail CI if container is unable to run after being built


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 10, 2026 06:25
The production image used gcr.io/distroless/python3-debian12:nonroot
which ships Python 3.11.2, incompatible with the Python 3.12 backend.
Compiled extensions (pydantic_core) fail to load at runtime.

Changes:
- Use python:3.12-slim as production base with non-root user
- Add HEALTHCHECK to Dockerfile
- Add smoke test step to docker.yaml CI that starts the container and
  validates /api/v1/health before pushing

Co-authored-by: fajfer <11696312+fajfer@users.noreply.github.com>
Co-authored-by: fajfer <11696312+fajfer@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix production image and add smoke test to CI fix: replace distroless Python 3.11 base with python:3.12-slim and add CI smoke test Feb 10, 2026
Copilot AI requested a review from fajfer February 10, 2026 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants