refacto: Changing some docker images to hardened non-root ones + README update
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import pg from "pg";
|
||||
|
||||
const DATABASE_URL =
|
||||
process.env.DATABASE_URL ?? "postgres://game:game@localhost:5432/star_wars_grid";
|
||||
if (!process.env.DATABASE_URL) {
|
||||
throw new Error("[startup] DATABASE_URL environment variable is required but not set.");
|
||||
}
|
||||
if (!process.env.USERS_DATABASE_URL) {
|
||||
throw new Error("[startup] USERS_DATABASE_URL environment variable is required but not set.");
|
||||
}
|
||||
|
||||
const USERS_DATABASE_URL =
|
||||
process.env.USERS_DATABASE_URL ?? "postgres://users:users@localhost:5433/star_wars_users";
|
||||
|
||||
export const pool = new pg.Pool({ connectionString: DATABASE_URL });
|
||||
export const usersPool = new pg.Pool({ connectionString: USERS_DATABASE_URL });
|
||||
export const pool = new pg.Pool({ connectionString: process.env.DATABASE_URL });
|
||||
export const usersPool = new pg.Pool({ connectionString: process.env.USERS_DATABASE_URL });
|
||||
Reference in New Issue
Block a user