feat(bugsink): migrate from MySQL to PostgreSQL and update configuration (#388)

- Replace MySQL 8.4 with PostgreSQL 17-alpine for better performance
- Update environment variables to use POSTGRES_* naming convention
- Change health checks to use pg_isready for PostgreSQL compatibility
- Update template.toml to reflect new database and configuration structure
- Set version to 'latest' in meta.json for continuous updates
This commit is contained in:
Jainil Prajapati
2025-09-26 08:24:42 +05:30
committed by GitHub
parent f84b9c45fc
commit 719ad62852
3 changed files with 45 additions and 31 deletions

View File

@@ -1,38 +1,46 @@
version: "3.8"
services:
mysql:
image: mysql:8.4
db:
image: postgres:17-alpine
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: $DB_PASSWORD
MYSQL_DATABASE: bugsink
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- my-datavolume:/var/lib/mysql
- db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "exit | mysql -h localhost -P 3306 -u root -p$$MYSQL_ROOT_PASSWORD" ] # 'exit |' closes the MySQL input prompt
interval: 1s
timeout: 20s
retries: 30
test: ["CMD-SHELL", "pg_isready -h db"]
retries: 5
start_period: 10s
interval: 5s
timeout: 5s
web:
image: bugsink/bugsink
image: bugsink/bugsink:latest
depends_on:
mysql:
db:
condition: service_healthy
restart: unless-stopped
ports:
- "8000"
expose:
- 8000
environment:
SECRET_KEY: "${SECRET_KEY}"
CREATE_SUPERUSER: admin:${ADMIN_PASSWORD}
SECRET_KEY: ${SECRET_KEY}
CREATE_SUPERUSER: ${CREATE_SUPERUSER}
PORT: 8000
DATABASE_URL: mysql://root:${DB_PASSWORD}@mysql:3306/bugsink
BASE_URL: http://${MAIN_DOMAIN}
BEHIND_HTTPS_PROXY: "false" # Change this for setups behind a proxy w/ ssl enabled
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
BEHIND_HTTPS_PROXY: ${BEHIND_HTTPS_PROXY}
BASE_URL: ${BASE_URL}
healthcheck:
test: ["CMD-SHELL", "python -c 'import requests; requests.get(\"http://localhost:8000/\").raise_for_status()'"]
test:
[
"CMD-SHELL",
'python -c ''import requests; requests.get("http://localhost:8000/").raise_for_status()''',
]
interval: 5s
timeout: 20s
retries: 10
volumes:
my-datavolume:
db-data:

View File

@@ -1,18 +1,24 @@
[variables]
main_domain = "${domain}"
secret_key = "#&^%@!z$*p9s8r7q6p5o4n3m2l1k0j9h8g7f6e5d4c3b2a1Z0Y9X8W7V6U5T4S3R2Q1P0O9N8M7L6K5J4I3H2G1F0E9D8C7B6A5"
db_password = "${password:16}"
admin_password = "${password:16}"
postgres_user = "bugsinkuser"
postgres_password = "${password:32}"
postgres_db = "bugsink"
secret_key = "${password:64}"
superuser = "admin:admin"
behind_https_proxy = "false"
[config]
[config.env]
DB_PASSWORD = "${db_password}"
MAIN_DOMAIN = "${main_domain}"
SECRET_KEY = "${secret_key}"
ADMIN_PASSWORD = "${admin_password}"
[[config.domains]]
serviceName = "web"
port = 8_000
port = 8000
host = "${main_domain}"
[config.env]
POSTGRES_USER = "${postgres_user}"
POSTGRES_PASSWORD = "${postgres_password}"
POSTGRES_DB = "${postgres_db}"
SECRET_KEY = "${secret_key}"
CREATE_SUPERUSER = "${superuser}"
BEHIND_HTTPS_PROXY = "${behind_https_proxy}"
BASE_URL = "https://${main_domain}"

View File

@@ -805,7 +805,7 @@
{
"id": "bugsink",
"name": "Bugsink",
"version": "v1.4.2",
"version": "latest",
"description": "Bugsink is a self-hosted Error Tracker. Built to self-host; Sentry-SDK compatible; Scalable and reliable",
"logo": "bugsink.png",
"links": {