pdf-parse@2.4.5 pulls in @napi-rs/canvas (native Skia binary) which crashes on import in Alpine containers. Moved to lazy require() so the app starts normally and pdf-parse loads only when PDF conversion is actually requested. - Lazy-load pdf-parse in pdfToStatement to avoid startup crash - Add libc6-compat, fontconfig, freetype to Alpine runner stage - Increase npm fetch timeouts in both Dockerfiles for slow networks - Add connectionTimeoutMillis to pg Pool for faster failure detection
12 lines
268 B
TypeScript
12 lines
268 B
TypeScript
import { Pool } from 'pg';
|
|
import { config } from '../config';
|
|
|
|
export const pool = new Pool({
|
|
host: config.db.host,
|
|
port: config.db.port,
|
|
database: config.db.database,
|
|
user: config.db.user,
|
|
password: config.db.password,
|
|
connectionTimeoutMillis: 5000,
|
|
});
|