File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -x
3+ set -eo pipefail
4+
5+ # Check if a custom user has been set, otherwise default to 'postgres'
6+ DB_USER=${POSTGRES_USER:= postgres}
7+ # Check if a custom password has been set, otherwise default to 'password'
8+ DB_PASSWORD=" ${POSTGRES_PASSWORD:= password} "
9+ # Check if a custom database name has been set, otherwise default to 'bibimbap'
10+ DB_NAME=" ${POSTGRES_DB:= bibimbap} "
11+ # Check if a custom port has been set, otherwise default to '5432'
12+ DB_PORT=" ${POSTGRES_PORT:= 5432} "
13+ # Check if a custom host has been set, otherwise default to 'localhost'
14+ DB_HOST=" ${POSTGRES_HOST:= localhost} "
15+
16+ # Launch Postgres using Docker
17+ docker run \
18+ -e POSTGRES_USER=${DB_USER} \
19+ -e POSTGRES_PASSWORD=${DB_PASSWORD} \
20+ -e POSTGRES_DB=${DB_NAME} \
21+ -p " ${DB_PORT} " :5432 \
22+ -d postgres \
23+ postgres -N 1000
24+ # ^ Increased maximum number of connections for testing purposes
You can’t perform that action at this time.
0 commit comments