Make Docker Compose Coolify-ready

This commit is contained in:
2026-02-20 22:41:21 -05:00
parent 6e299b1e1f
commit 575bf91ecd
6 changed files with 48 additions and 15 deletions

View File

@@ -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,

View File

@@ -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