Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hello at all,
I’m deploying a Laravel application with DO Apps Platform. Deployment works but I have an issue with the App environment variables.
I did set in the DO Console
DB_HOST=${db-mysql-fra1.HOSTNAME}
DB_PORT=${db-mysql-fra1.PORT}
DB_DATABASE=${db-mysql-fra1.DATABASE}
DB_USERNAME=${db-mysql-fra1.USERNAME}
DB_PASSWORD=${db-mysql-fra1.PASSWORD}
In the build process, I added a php artisan migrate --force but it fails with:
php_network_getaddresses: getaddrinfo for ${db-mysql-fra1.HOSTNAME} failed. The envvar is not translated.
Once launched, I have the same issue with php-fpm. If I do:
$ php artisan tinker
> echo env('DB_HOST'); // db-mysql-fra1-user.b.db.ondigitalocean.com
> echo config('database.connections.mysql.host'); // ${db-mysql-fra1.HOSTNAME}
> exit
$ php artisan config:clear
$ php artisan tinker
> echo config('database.connections.mysql.host'); // db-mysql-fra1-user-0.b.db.ondigitalocean.com
So I must manually clear the config cache to make it work. Of course, I added the php artisan config:clear in the build phase commands but same:
php artisan cache:clear
php artisan config:clear
php artisan migrate --force
npm run build
I must add that I previously set a php artisan optimize in the build commands but I removed it as I thought this was the problem.
Thanks in advance,
Axel
keneucker
keneucker
KFSys
KFSys
Kashif S.
Ondrej Hradec
Parousia
6f2fdef512d74fd598fcaed809d4b8
petarsubotic
enr9
7785fb23466745bea08552220fe464