Skip to content

Commit 9227eef

Browse files
authored
Merge pull request #1841 from hashtopolis/1840-docker-entrypoint
Read DB port env variable properly in db check in entrypoint
2 parents 767dc50 + bcffa3b commit 9227eef

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docker-entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,16 @@ if [[ "$HASHTOPOLIS_DB_TYPE" == "mysql" ]]; then
1818
echo "Using MySQL..."
1919
DB_CMD="mysql -u${HASHTOPOLIS_DB_USER} -p${HASHTOPOLIS_DB_PASS} -h ${HASHTOPOLIS_DB_HOST} --skip-ssl"
2020
DB_TYPE="mysql"
21+
if [[ -n "${HASHTOPOLIS_DB_PORT}" ]]; then
22+
DB_CMD="${DB_CMD} -P${HASHTOPOLIS_DB_PORT}"
23+
fi
2124
elif [[ "$HASHTOPOLIS_DB_TYPE" == "postgres" ]]; then
2225
echo "Using postgres..."
2326
DB_CMD="psql -U${HASHTOPOLIS_DB_USER} -h ${HASHTOPOLIS_DB_HOST} ${HASHTOPOLIS_DB_DATABASE}"
2427
DB_TYPE="postgres"
28+
if [[ -n "${HASHTOPOLIS_DB_PORT}" ]]; then
29+
DB_CMD="${DB_CMD} -p${HASHTOPOLIS_DB_PORT}"
30+
fi
2531
else
2632
echo "INVALID DATABASE TYPE PROVIDED: $HASHTOPOLIS_DB_TYPE"
2733
exit 1

0 commit comments

Comments
 (0)