Skip to content

Commit

Permalink
feat: automatic APP_URL update in shopware
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim committed Aug 30, 2024
1 parent d8a70ce commit 2ab8fc2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rootfs/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ set -e

sh /etc/scripts/fix-mount.sh

exec $@
exec $@
3 changes: 2 additions & 1 deletion rootfs/etc/Procfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
nginx: /usr/sbin/nginx
php-fpm: /usr/sbin/php-fpm
mysql: /usr/bin/mariadbd --basedir=/usr --datadir=/var/lib/mariadb --plugin-dir=/usr/lib/mariadb/plugin --user=www-data
mariadb: /usr/bin/mariadbd --basedir=/usr --datadir=/var/lib/mariadb --plugin-dir=/usr/lib/mariadb/plugin --user=www-data
valkey: /usr/bin/valkey-server --dir /tmp
mailpit: /usr/bin/mailpit --db-file /tmp/mailpit.db
maintenance: /etc/scripts/app-url.sh
11 changes: 11 additions & 0 deletions rootfs/etc/scripts/app-url.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env sh

until mariadb-admin ping; do sleep 1; done

if [[ -n $APP_URL ]]; then
mariadb -uroot -proot shopware -e "UPDATE sales_channel_domain set url = '${APP_URL}'"
fi

echo "Updated sales_channel_domain, sleeping now..."

sleep infinity

0 comments on commit 2ab8fc2

Please sign in to comment.