Skip to content

Commit

Permalink
Merge pull request #51 from shopware/extract-database-host-and-port-f…
Browse files Browse the repository at this point in the history
…rom-url

Extract port and host from url
  • Loading branch information
shyim authored Jan 24, 2024
2 parents 5c55ae5 + ac872e0 commit 9b96692
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 15 deletions.
2 changes: 1 addition & 1 deletion 8.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM docker.io/library/php:8.0.28-fpm-alpine@sha256:8ad90c2835edc3ec378552317c07

ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

RUN apk add --no-cache icu-data-full curl jq caddy && \
RUN apk add --no-cache icu-data-full curl jq trurl caddy && \
apk upgrade --no-cache && \
chmod +x /usr/local/bin/install-php-extensions && \
install-php-extensions bcmath gd intl mysqli pdo_mysql pcntl sockets bz2 gmp soap zip ffi redis opcache apcu amqp && \
Expand Down
6 changes: 4 additions & 2 deletions 8.0/rootfs/setup
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
set -e
set -x

try=0
database_host=$(trurl $DATABASE_URL --get '{host}')
database_port=$(trurl $DATABASE_URL --get '{port}')

try=0
if [[ $MYSQL_WAIT_SECONDS != 0 ]]; then
until nc -z -v -w30 $DATABASE_HOST $DATABASE_PORT
until nc -z -v -w30 $database_host ${database_port:-3306}
do
echo "Waiting for database connection..."
# wait for 5 seconds before check again
Expand Down
2 changes: 1 addition & 1 deletion 8.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM docker.io/library/php:8.1.26-fpm-alpine@sha256:b480cfc032ee8fc1e0fcc0925301

ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

RUN apk add --no-cache icu-data-full curl jq caddy && \
RUN apk add --no-cache icu-data-full curl jq trurl caddy && \
apk upgrade --no-cache && \
chmod +x /usr/local/bin/install-php-extensions && \
install-php-extensions bcmath gd intl mysqli pdo_mysql pcntl sockets bz2 gmp soap zip ffi redis opcache apcu amqp && \
Expand Down
6 changes: 4 additions & 2 deletions 8.1/rootfs/setup
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
set -e
set -x

try=0
database_host=$(trurl $DATABASE_URL --get '{host}')
database_port=$(trurl $DATABASE_URL --get '{port}')

try=0
if [[ $MYSQL_WAIT_SECONDS != 0 ]]; then
until nc -z -v -w30 $DATABASE_HOST $DATABASE_PORT
until nc -z -v -w30 $database_host ${database_port:-3306}
do
echo "Waiting for database connection..."
# wait for 5 seconds before check again
Expand Down
2 changes: 1 addition & 1 deletion 8.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM docker.io/library/php:8.2.14-fpm-alpine@sha256:27d888ffb761d4ceb967067bb238

ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

RUN apk add --no-cache icu-data-full curl jq caddy && \
RUN apk add --no-cache icu-data-full curl jq trurl caddy && \
apk upgrade --no-cache && \
chmod +x /usr/local/bin/install-php-extensions && \
install-php-extensions bcmath gd intl mysqli pdo_mysql pcntl sockets bz2 gmp soap zip ffi redis opcache apcu amqp && \
Expand Down
6 changes: 4 additions & 2 deletions 8.2/rootfs/setup
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
set -e
set -x

try=0
database_host=$(trurl $DATABASE_URL --get '{host}')
database_port=$(trurl $DATABASE_URL --get '{port}')

try=0
if [[ $MYSQL_WAIT_SECONDS != 0 ]]; then
until nc -z -v -w30 $DATABASE_HOST $DATABASE_PORT
until nc -z -v -w30 $database_host ${database_port:-3306}
do
echo "Waiting for database connection..."
# wait for 5 seconds before check again
Expand Down
2 changes: 1 addition & 1 deletion 8.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM docker.io/library/php:8.3.1-fpm-alpine@sha256:3b8c170dfa6e6c06a074656837af4

ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

RUN apk add --no-cache icu-data-full curl jq caddy && \
RUN apk add --no-cache icu-data-full curl jq trurl caddy && \
apk upgrade --no-cache && \
chmod +x /usr/local/bin/install-php-extensions && \
install-php-extensions bcmath gd intl mysqli pdo_mysql pcntl sockets bz2 gmp soap zip ffi redis opcache apcu amqp && \
Expand Down
6 changes: 4 additions & 2 deletions 8.3/rootfs/setup
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
set -e
set -x

try=0
database_host=$(trurl $DATABASE_URL --get '{host}')
database_port=$(trurl $DATABASE_URL --get '{port}')

try=0
if [[ $MYSQL_WAIT_SECONDS != 0 ]]; then
until nc -z -v -w30 $DATABASE_HOST $DATABASE_PORT
until nc -z -v -w30 $database_host ${database_port:-3306}
do
echo "Waiting for database connection..."
# wait for 5 seconds before check again
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM docker.io/library/php:${PHP_PATCH_VERSION}-fpm-alpine@${PHP_DIGEST}

ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

RUN apk add --no-cache icu-data-full curl jq caddy && \
RUN apk add --no-cache icu-data-full curl jq trurl caddy && \
apk upgrade --no-cache && \
chmod +x /usr/local/bin/install-php-extensions && \
install-php-extensions bcmath gd intl mysqli pdo_mysql pcntl sockets bz2 gmp soap zip ffi redis opcache apcu amqp && \
Expand Down
6 changes: 4 additions & 2 deletions rootfs/setup
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
set -e
set -x

try=0
database_host=$(trurl $DATABASE_URL --get '{host}')
database_port=$(trurl $DATABASE_URL --get '{port}')

try=0
if [[ $MYSQL_WAIT_SECONDS != 0 ]]; then
until nc -z -v -w30 $DATABASE_HOST $DATABASE_PORT
until nc -z -v -w30 $database_host ${database_port:-3306}
do
echo "Waiting for database connection..."
# wait for 5 seconds before check again
Expand Down

0 comments on commit 9b96692

Please sign in to comment.