Ensure uid, gid for postgres, redis and discourse stays consistent (#835)
authorAlan Guo Xiang Tan <gxtan1990@gmail.com>
Thu, 22 Aug 2024 02:57:29 +0000 (10:57 +0800)
committerGitHub <noreply@github.com>
Thu, 22 Aug 2024 02:57:29 +0000 (10:57 +0800)
commit1d7323204ba9a963695d87feb3058a1191271dd2
tree2d5f72b9baab3e0f8f84affec11cc168d1f66133
parent98c5337c1221affc14adc474919a04b909fe9d84
Ensure uid, gid for postgres, redis and discourse stays consistent (#835)

When updating to `debian/base:bookworm` from `debian/base:bullseye`, we
noticed that the uid of the `postgres` and `redis` user changed leading
to permission issues when trying to access directories of mounted volumn
which was previously created with the old uid. The change is because the
`_apt` user is assigned a uid of `42` in Debian bookworm instead of `100`
in Debian bullseye. As a result, the `postgres` user created by the `postgres`
package is automatically assigned a uid of `100` in Debian bookworm instead of `101` in Debian
bullseye.

This commit updates the `slim.Dockefile` to manually add the `postgres`
user and group assigning it a gid of `104` and uid of `101`. The `redis`
user and group is assigned a uid of `103` and a gid of `106`. The
`discourse` user and group is assigned a uid of `1000` and gid of
`1000`.
image/base/slim.Dockerfile