Skip to content

Commit

Permalink
Updated docker entry point so that it tries to download the GeoLite2 …
Browse files Browse the repository at this point in the history
…db file when the license key was provided
  • Loading branch information
acelaya committed Apr 8, 2021
1 parent 7b4456e commit 104b739
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ data/log/*
data/locks/*
data/proxies/*
data/migrations_template.txt
data/GeoLite2-City.*
data/GeoLite2-City*
data/database.sqlite
data/shlink-tests.db
CHANGELOG.md
Expand Down
2 changes: 1 addition & 1 deletion docker/config/shlink_in_docker.local.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public function getMercureConfig(): array
],

'geolite2' => [
'license_key' => env('GEOLITE_LICENSE_KEY', 'G4Lm0C60yJsnkdPi'),
'license_key' => env('GEOLITE_LICENSE_KEY', 'G4Lm0C60yJsnkdPi'), // Deprecated. Remove the default value
],

'mercure' => $helper->getMercureConfig(),
Expand Down
6 changes: 6 additions & 0 deletions docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ php vendor/doctrine/orm/bin/doctrine.php orm:generate-proxies -n -q
echo "Clearing entities cache..."
php vendor/doctrine/orm/bin/doctrine.php orm:clear-cache:metadata -n -q

# Try to download GeoLite2 db file only if the license key env var was defined
if [ ! -z "${GEOLITE_LICENSE_KEY}" ]; then
echo "Downloading GeoLite2 db file..."
php bin/cli visit:download-db -n -q
fi

# When restarting the container, swoole might think it is already in execution
# This forces the app to be started every second until the exit code is 0
until php vendor/bin/laminas mezzio:swoole:start; do sleep 1 ; done

0 comments on commit 104b739

Please sign in to comment.