Improve postgres versioning and client

Created on 11 May 2021, over 3 years ago
Updated 30 October 2023, about 1 year ago

Problem/Motivation

Currently the postgres version is tagged to 12 on the docker-compose.development.yml file https://git.drupalcode.org/project/farm/-/blob/2.x/docker/docker-compose...

This might conflict with the version of the client installed in the web container https://git.drupalcode.org/project/farm/-/blob/2.x/docker/Dockerfile#L57

Steps to reproduce

This can cause issues with drush sql:dump that uses pgdump as the version installed mismatches (client is 11, server is 12).

Proposed resolution

As a "quick and easy fix" we could match the client installed in the web docker file, for example:

RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
    cat /etc/apt/sources.list.d/pgdg.list && \
    curl --silent https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
    apt-get update && \
    apt-get install --no-install-recommends -y postgresql-client-12 && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

Also, instead of tagging postgre 12, we can add an environment variable that could be set per client so the postgre is installed as 12 by default but other can be installed too

πŸ“Œ Task
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain pcambra Asturies

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024