Allow Postgres database connection when using the docker image (#342)

* Add pgsql driver and use correct port in waitfordb.sh.
* Log host while waiting for database.
This commit is contained in:
Gillis Van Ginderachter
2017-06-21 02:14:59 +01:00
committed by Régis Freyd
parent a1d8c525cd
commit 71375fbe50
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ FROM alpine:3.6
EXPOSE 80:80
RUN apk update && apk add apache2 curl git make netcat-openbsd nodejs-current-npm openssl php7 php7-apache2 php7-ctype php7-dom php7-fileinfo php7-gd php7-iconv php7-intl php7-json php7-mbstring php7-mysqli php7-openssl php7-pdo_mysql php7-phar php7-session php7-tokenizer php7-xml php7-xmlreader php7-xmlwriter php7-zip php7-zlib
RUN apk update && apk add apache2 curl git make netcat-openbsd nodejs-current-npm openssl php7 php7-apache2 php7-ctype php7-dom php7-fileinfo php7-gd php7-iconv php7-intl php7-json php7-mbstring php7-mysqli php7-openssl php7-pdo_mysql php7-phar php7-session php7-tokenizer php7-xml php7-xmlreader php7-xmlwriter php7-zip php7-zlib php7-pgsql php7-pdo_pgsql
RUN npm install -g bower
RUN mkdir -p /run/apache2
+4 -4
View File
@@ -1,12 +1,12 @@
#!/bin/sh
echo "Connecting to ${DB_HOST}"
echo "Connecting to ${DB_HOST}:${DB_PORT}"
while true; do
nc -z ${DB_HOST} 3306 && break
echo "Unable to connect to MySQL; sleeping"
nc -z ${DB_HOST} ${DB_PORT} && break
echo "Unable to connect to ${DB_HOST}:${DB_PORT}; sleeping"
sleep 1
done
echo "Waiting for MySQL to settle"
echo "Waiting for database to settle"
sleep 3