Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
- /tmp
- /var/run/postgresql
volumes:
- ${POSTGRES_DATA_PATH}:/var/lib/postgresql/data
- ${POSTGRES_DATA_PATH}:/var/lib/postgresql
environment:
# timezone inside container
- TZ
Expand Down
4 changes: 2 additions & 2 deletions env.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RESTART_POLICY=unless-stopped
## Please keep in mind this will create a superuser and it's recommended to use a less privileged
## user to connect to the database.
## A guide on how to change the database user to a nonsuperuser can be found in docs/creation-of-nonsuperuser.md
POSTGRES_IMAGE_TAG=14-alpine
POSTGRES_IMAGE_TAG=18-alpine

Choose a reason for hiding this comment

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

With the update to pg 18, the docker-compose.yml file needs be modified to accommodate the POSTGRES_DATA_PATH change (which is done). Should we add a note here (or elsewhere) to inform and warn users who may be still using previous versions ? Asking @hanzei for advice.

Copy link
Author

Choose a reason for hiding this comment

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

Correct yeah, anyone using the postgres image prior to version 17 will need to adjust their volume mounts. Folks on older postgres versions looking to upgrade will have to refer to the upstream guide, since db upgrades are not automatic nor trivial.

Adding a note here doesn't hurt though.

Copy link
Contributor

Choose a reason for hiding this comment

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

For reference, the related PR is docker-library/postgres#1259.

For anyone upgrading from an older version, the change in PGDATA requires a manual migration. That is a major trap. Given that pg 18 is just out for 3 months, I'm leaning towards only upgrading to v17 and kicking that can down the road.

v17 is already quite new for pg standards.

Copy link
Author

Choose a reason for hiding this comment

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

I see what you’re saying, and I don’t totally disagree, but a postgres upgrade is manual no matter how you look at it. Even if you’re migrating from 16 to 17, you’ll need to dump the database, spin up a fresh instance and then import. There are fancier ways of course, but the process is always the same. At least with 18, future upgrades are much easier to carry out.

If a user happened to bump the version to 18 without changing the mount points, it’s not catastrophic. It’ll just spin up a fresh database in another directory. But that’s besides the point, this change here mainly benefits the users starting with a fresh deployment of mm, making it easier to perform upgrades later on. Anyone looking to upgrade should always refer to the mm documentation.

I don’t know, Postgres is historically very stable, and they have already released their second minor release. No issues in my environment for a few months now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair points 👍 I would love to see a short documentation on how to update the postgres container on https://docs.mattermost.com/deployment-guide/server/deploy-containers.html. @mrckndt I remember you working with a customer on a DB upgrade. Would you mind writing a short guide for our docs?

Copy link
Author

Choose a reason for hiding this comment

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

I'm happy to collaborate on some documentation too, just let me know! 🙂

Copy link
Contributor

Choose a reason for hiding this comment

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

Our docs are open source and available at https://github.com/mattermost/docs/. I would highly appreciate if you submit a PR @brandon1024 🎉

POSTGRES_DATA_PATH=./volumes/db/var/lib/postgresql/data

POSTGRES_USER=mmuser
Expand Down Expand Up @@ -63,7 +63,7 @@ MM_BLEVESETTINGS_INDEXDIR=/mattermost/bleve-indexes
## This will be 'mattermost-enterprise-edition' or 'mattermost-team-edition' based on the version of Mattermost you're installing.
MATTERMOST_IMAGE=mattermost-enterprise-edition
## Update the image tag if you want to upgrade your Mattermost version. You may also upgrade to the latest one. The example is based on the latest Mattermost ESR version.
MATTERMOST_IMAGE_TAG=10.11.5
MATTERMOST_IMAGE_TAG=10.11.8

## Make Mattermost container readonly. This interferes with the regeneration of root.html inside the container. Only use
## it if you know what you're doing.
Expand Down