improve: prepare for coolify and general self-hosting improvements (#175)

* fix(self-hosting): improve docker compose, add healthchecks, rename env SELF_HOSTED

* improve(db): improve initial migration when no data exists

* fix(db): misstakes were made

* improve(dashboard): better curl preview depending on project type

* fix(db): fix migrations

* fix(onboarding): ensure we publish event correctly

* wip

* fix: curl preview

* add coolify template

* fix(dashboard): page -> route

* fix

* fix env
This commit is contained in:
Carl-Gerhard Lindesvärd
2025-06-23 22:21:11 +02:00
committed by GitHub
parent 4a2dbc5c4d
commit 92d62c3e5c
22 changed files with 382 additions and 60 deletions

View File

@@ -36,7 +36,11 @@ export async function bootCron() {
},
];
if (process.env.SELF_HOSTED && process.env.NODE_ENV === 'production') {
if (
(process.env.NEXT_PUBLIC_SELF_HOSTED === 'true' ||
process.env.SELF_HOSTED) &&
process.env.NODE_ENV === 'production'
) {
jobs.push({
name: 'ping',
type: 'ping',

View File

@@ -57,6 +57,10 @@ async function start() {
});
});
app.get('/healthcheck', (req, res) => {
res.json({ status: 'ok' });
});
app.listen(PORT, () => {
console.log(`For the UI, open http://localhost:${PORT}/`);
});

View File

@@ -46,9 +46,10 @@ export async function deleteProjects(job: Job<CronQueuePayload>) {
];
for (const table of tables) {
const query = process.env.SELF_HOSTED
? `ALTER TABLE ${table} DELETE WHERE ${where};`
: `ALTER TABLE ${table}_replicated ON CLUSTER '{cluster}' DELETE WHERE ${where};`;
const query =
process.env.NEXT_PUBLIC_SELF_HOSTED === 'true'
? `ALTER TABLE ${table} DELETE WHERE ${where};`
: `ALTER TABLE ${table}_replicated ON CLUSTER '{cluster}' DELETE WHERE ${where};`;
await ch.command({
query,