feat: update Docker setup and documentation for PostgreSQL integration
Build & Push Docker Image / Docker Build & Push (push) Successful in 1m32s
Lint / Lint (push) Successful in 11s
Tests / Test (push) Successful in 9s

This commit is contained in:
Gabriel20xx committed 2026-08-01 19:53:32 +02:00
1 parent f56eac28f7
commit 14a7348632
7 files changed
+46 -130

No files matched your search

+3 -10
View File
@@ -36,17 +36,10 @@ class PostgresAdapter implements DBAdapter {
// OID 20 = INT8, OID 1700 = NUMERIC (keep default for now)
pgTypes.setTypeParser(20, (val: string) => parseInt(val, 10));
const connectionString = process.env.DATABASE_URL;
if (connectionString) {
this.pool = new Pool({ connectionString });
} else {
this.pool = new Pool({
host: process.env.PGHOST || 'localhost',
port: parseInt(process.env.PGPORT || '5432', 10),
user: process.env.PGUSER || 'postgres',
password: process.env.PGPASSWORD || '',
database: process.env.PGDATABASE || 'collabtable'
});
if (!connectionString) {
throw new Error('DATABASE_URL environment variable is required');
}
this.pool = new Pool({ connectionString });
}
async initialize(): Promise<void> {
+1 -2
View File
@@ -102,8 +102,7 @@ app.use('/', webRoutes);
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
console.log(`Environment: ${process.env.NODE_ENV || 'development'}`);
const source = process.env.DATABASE_URL ? 'DATABASE_URL' : 'PGHOST/PGDATABASE';
console.log(`Database: PostgreSQL (${source})`);
console.log('Database: PostgreSQL (DATABASE_URL)');
});
} catch (error) {
console.error('Database initialization error:', error);