Skip to content

build: install only libpq5 in the Docker image - #53

Merged
lesnik512 merged 1 commit into
mainfrom
build/dockerfile-libpq5
Sep 28, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
build/dockerfile-libpq5

Conversation

@lesnik512

Copy link
Copy Markdown
Member

The apt block installed build-essential and libpq-dev "for psycopg2", but the project depends on psycopg (3). Every locked dependency ships a Linux wheel for Python 3.14, so nothing is compiled. Pure-Python psycopg only needs the libpq runtime library, which Alembic uses inside the container.

Replaced both packages with libpq5.

Verification:

  • With the apt block removed entirely, just test fails at alembic downgrade base with ImportError: no pq wrapper available ... libpq library not found.
  • With libpq5, just build and just test pass: 31 tests, 100% coverage.
  • Image size in the litestar template: 692MB after the change, vs 1.2GB for an older local build with the old apt block (approximate comparison).

@lesnik512
lesnik512 merged commit a5e2616 into main Sep 28, 2026
2 checks passed
@lesnik512
lesnik512 deleted the build/dockerfile-libpq5 branch September 28, 2026 06:19
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