forked from sqlpad/sqlpad
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-entrypoint
More file actions
21 lines (19 loc) · 922 Bytes
/
docker-entrypoint
File metadata and controls
21 lines (19 loc) · 922 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
set -e
# Export the env variables
export SQLPAD_ADMIN="$SQLPAD_USER"
export SQLPAD_ADMIN_PASSWORD="$SQLPAD_PASSWORD"
export SQLPAD_PASSPHRASE="$SQLPAD_PASSWORD-$POSTGRES_DB-passphrase"
export SQLPAD_CONNECTIONS__postgres__host="$POSTGRES_HOST"
export SQLPAD_CONNECTIONS__postgres__database="$POSTGRES_DB"
export SQLPAD_CONNECTIONS__postgres__username="$POSTGRES_USER"
export SQLPAD_CONNECTIONS__postgres__password="$POSTGRES_PASSWORD"
export SQLPAD_CONNECTIONS__postgres__port="$POSTGRES_PORT"
# This iterates any sh file in the directory and executes them before our server starts
# Note: we intentionally source the files, allowing scripts to set vars that override default behavior.
if [ -d "/etc/docker-entrypoint.d" ]; then
while IFS= read -r -d $'\0' file; do
. "$file"
done < <(find /etc/docker-entrypoint.d -maxdepth 1 -name '*.sh' -type f -print0)
fi
exec node /usr/app/server.js $@