Implemented postgres support

This commit is contained in:
Kevin Veen-Birkenbach 2023-12-19 10:00:16 +01:00
parent 5d7905c837
commit 31bbe9a457
2 changed files with 13 additions and 14 deletions

View File

@ -21,21 +21,20 @@ services:
database: database:
logging: logging:
driver: journald driver: journald
image: mariadb image: postgres:16
restart: always restart: unless-stopped
environment:
MYSQL_DATABASE: "matrix"
MYSQL_USER: "matrix"
MYSQL_PASSWORD: "{{matrix_database_password}}"
MYSQL_ROOT_PASSWORD: "{{matrix_database_password}}"
MARIADB_AUTO_UPGRADE: "1"
volumes: volumes:
- database:/var/lib/mysql - database:/var/lib/postgresql/data
environment:
- POSTGRES_DB=matrix
- POSTGRES_USER=matrix
- POSTGRES_PASSWORD={{matrix_database_password}}
- POSTGRES_INITDB_ARGS=--encoding=UTF8 --locale=C
healthcheck: healthcheck:
test: "/usr/bin/mariadb --user=matrix --password={{matrix_database_password}} --execute \"SHOW DATABASES;\"" test: ["CMD-SHELL", "pg_isready -U matrix"]
interval: 3s interval: 10s
timeout: 1s timeout: 5s
retries: 5 retries: 6
# bridges # bridges
#mautrix-telegram: #mautrix-telegram:

View File

@ -9,7 +9,7 @@ listeners:
- names: [client, federation] - names: [client, federation]
compress: false compress: false
database: database:
name: mysql name: psycopg2
args: args:
user: matrix user: matrix
password: {{matrix_database_password}} password: {{matrix_database_password}}