mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 03:55:37 +01:00
schema + docker cleanups
This commit is contained in:
parent
ae7de014a6
commit
4a21d9e9d9
9 changed files with 119 additions and 293 deletions
|
|
@ -1,30 +0,0 @@
|
|||
require('dotenv').config();
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
function getDatabase() {
|
||||
const type =
|
||||
process.env.DATABASE_TYPE ||
|
||||
(process.env.DATABASE_URL && process.env.DATABASE_URL.split(':')[0]);
|
||||
|
||||
if (type === 'postgres') {
|
||||
return 'postgresql';
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
const databaseType = getDatabase();
|
||||
|
||||
if (!databaseType || !['mysql', 'postgresql'].includes(databaseType)) {
|
||||
throw new Error('Missing or invalid database');
|
||||
}
|
||||
|
||||
console.log(`Database type detected: ${databaseType}`);
|
||||
|
||||
const src = path.resolve(__dirname, `../prisma/schema.${databaseType}.prisma`);
|
||||
const dest = path.resolve(__dirname, '../prisma/schema.prisma');
|
||||
|
||||
fs.copyFileSync(src, dest);
|
||||
|
||||
console.log(`Copied ${src} to ${dest}`);
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
const cli = require('next/dist/cli/next-start');
|
||||
|
||||
cli.nextStart(['-p', process.env.PORT || 3000, '-H', process.env.HOSTNAME || '0.0.0.0']);
|
||||
cli.nextStart(['-p', process.env.PORT || 50001, '-H', process.env.HOSTNAME || '0.0.0.0']);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue