Skip to content
12 changes: 10 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,19 @@ FROM python:3.10.12-slim-bullseye

WORKDIR /dockermount

##### Install postgres 16
RUN apt-get update && apt-get install -y wget gnupg lsb-release \
&& wget -qO - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" \
> /etc/apt/sources.list.d/pgdg.list \
&& apt-get update \
&& apt-get install -y postgresql-16
Comment on lines +14 to +19
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the benefit of installing this way vs updating the existing pattern to apt install postgresql-16?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was the first thing I tested. It seems the base image does not come with postgresql-16 package

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the postgresql-16 package is only available in Debian's unstable branch, so installing it from Postgres' repo is the easiest option.



RUN apt update && apt install -y \
curl \
gcc \
libpq-dev \
postgresql-13
libpq-dev

COPY . /dockermount

Expand Down