Make Docker Compose Coolify-ready
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import { betterAuth } from "better-auth";
|
||||
import { Pool } from "pg";
|
||||
|
||||
const defaultDatabaseUrl = `postgres://${process.env.POSTGRES_USER || 'postgres'}:${process.env.POSTGRES_PASSWORD || 'postgres'}@${process.env.POSTGRES_HOST || 'localhost'}:5432/${process.env.POSTGRES_DB || 'fiscal'}`;
|
||||
|
||||
export const auth = betterAuth({
|
||||
database: new Pool({
|
||||
connectionString: process.env.DATABASE_URL || 'postgres://postgres:postgres@localhost:5432/fiscal',
|
||||
connectionString: process.env.DATABASE_URL || defaultDatabaseUrl,
|
||||
}),
|
||||
emailAndPassword: {
|
||||
enabled: true,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import postgres from 'postgres';
|
||||
|
||||
const sql = postgres(process.env.DATABASE_URL || 'postgres://postgres:postgres@localhost:5432/fiscal', {
|
||||
const defaultDatabaseUrl = `postgres://${process.env.POSTGRES_USER || 'postgres'}:${process.env.POSTGRES_PASSWORD || 'postgres'}@${process.env.POSTGRES_HOST || 'localhost'}:5432/${process.env.POSTGRES_DB || 'fiscal'}`;
|
||||
|
||||
const sql = postgres(process.env.DATABASE_URL || defaultDatabaseUrl, {
|
||||
max: 10,
|
||||
idle_timeout: 20,
|
||||
connect_timeout: 10
|
||||
|
||||
Reference in New Issue
Block a user