Skip to content

Conversation

@srgvg
Copy link

@srgvg srgvg commented Jan 20, 2026

Summary

  • Fix Dockerfile to install Python packages to system Python instead of a virtualenv
  • Add missing hypercorn dependency (required by run.sh prod)
  • Set PIPENV_PYTHON to ensure correct Python version is used on Alpine

Problem

The original pipenv install creates a virtual environment, but the application runs with system Python. This causes:

ModuleNotFoundError: No module named 'privex'

Additionally, hypercorn was missing from the Pipfile despite being required by run.sh prod.

Changes

  1. Add ENV PIPENV_PYTHON=/usr/local/bin/python3.9 to ensure pipenv uses the correct Python
  2. Use pipenv lock && pipenv install --system --deploy to install packages system-wide
  3. Add hypercorn = "*" to Pipfile

Test plan

  • Built and tested image locally
  • Verified all dependencies (privex-helpers, hypercorn, etc.) are available to system Python
  • Application starts successfully with ./run.sh prod
  • Deployed and verified in Kubernetes cluster

The original Dockerfile used `pipenv install` which creates a virtual
environment. However, the application is run with system Python, causing
ModuleNotFoundError for privex-helpers and other dependencies.

Generate lock file and use `--system --deploy` flags to install packages
to the system Python, making them available when the app runs.
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.

1 participant