From b3861f4c2f57d33c358acb174cd863dbc60233cc Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Sun, 11 Oct 2026 09:26:34 +0700 Subject: [PATCH] feat(gitea): move the database to PostgreSQL 18 --- gitea/README.md | 12 ++++++++---- gitea/compose.yml | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/gitea/README.md b/gitea/README.md index b650c83..6ee38cb 100644 --- a/gitea/README.md +++ b/gitea/README.md @@ -6,7 +6,7 @@ Self-hosted [Gitea](https://about.gitea.com/) backed by PostgreSQL. | Service | Image | Internal port | Domain | | --- | --- | --- | --- | -| `db` | `postgres:16-alpine` | 5432 | none | +| `db` | `postgres:18-alpine` | 5432 | none | | `gitea` | `gitea/gitea:28` | 3000 | `GITEA_ROOT_URL` | In Coolify, give `gitea` a domain on port 3000 matching `GITEA_ROOT_URL`. @@ -35,8 +35,12 @@ itself. this long. - **`gitea/gitea:28`.** Gitea publishes major tags; the major pin takes updates without a surprise major upgrade. -- **`postgres:16-alpine`** stays on 16: a new Postgres major cannot read the - existing data directory without a dump and restore. +- **`postgres:18-alpine`**, the newest Postgres major; Gitea needs 12 or + later. The major stays pinned because a new major cannot read an existing + data directory without a dump and restore. From 18 the image keeps its data + in `/var/lib/postgresql/18/docker`, so `db-data` mounts at + `/var/lib/postgresql`, which lets a later major sit beside it on the same + volume. ## Usage @@ -48,5 +52,5 @@ token for any tool that mirrors into it. | Volume | Holds | | --- | --- | -| `db-data` | PostgreSQL data | +| `db-data` | PostgreSQL data, under `18/docker` | | `gitea-data` | Repositories, Gitea config and state | diff --git a/gitea/compose.yml b/gitea/compose.yml index 8eedb45..bf4de30 100644 --- a/gitea/compose.yml +++ b/gitea/compose.yml @@ -1,13 +1,13 @@ services: db: - image: postgres:16-alpine + image: postgres:18-alpine restart: unless-stopped environment: POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-gitea} POSTGRES_USER: gitea POSTGRES_DB: gitea volumes: - - db-data:/var/lib/postgresql/data + - db-data:/var/lib/postgresql healthcheck: test: ["CMD-SHELL", "pg_isready -U gitea -d gitea"] interval: 5s