R
Railwayā€¢4w ago
Faith

Deploying laravel

Hey railway team im having a hard time trying to build my laravel project with some extra build comands these are the commands "composer install && php artisan config:cache && php artisan event:cache && php artisan route:cache && php artisan optimize && php artisan migrate" it says error but the error is not very helpful(look image attached) Project id: 3eeeee07-630f-4d9a-8a7c-4d98d84e0d34
No description
44 Replies
Percy
Percyā€¢4w ago
Project ID: 3eeeee07-630f-4d9a-8a7c-4d98d84e0d34
Brody
Brodyā€¢4w ago
I would recommend checking out our guide - https://docs.railway.app/guides/laravel
Faith
FaithOPā€¢4w ago
"SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for database.railway.internal failed: Name or service not known (Connection: mariadb, SQL: select table_name as name, (data_length + index_length) as size, table_comment as comment, engine as engine, table_collation as collation from information_schema.tables where table_schema = 'cvr-api' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED') order by table_name)" how come the Database URL does not seem to connect any idea
Brody
Brodyā€¢4w ago
during build?
Faith
FaithOPā€¢4w ago
DB_CONNECTION="mariadb"
DB_HOST="database.railway.internal"
DB_PORT="3306"
DB_DATABASE="cvr-api"
DB_USERNAME="root"
DB_PASSWORD="7aj6hwcmcbwq83u5"
DB_CONNECTION="mariadb"
DB_HOST="database.railway.internal"
DB_PORT="3306"
DB_DATABASE="cvr-api"
DB_USERNAME="root"
DB_PASSWORD="7aj6hwcmcbwq83u5"
yea
Faith
FaithOPā€¢4w ago
No description
Brody
Brodyā€¢4w ago
because the private network is not available during the build, please read the guide to see how to get around that
Faith
FaithOPā€¢4w ago
okay thank you sir " You will need to bind to a IPv6 port to receive traffic on the private network. " right
Brody
Brodyā€¢4w ago
no, please read the entire guide
Faith
FaithOPā€¢4w ago
šŸ˜­ i cant find what ur talking abotut bro
Faith
FaithOPā€¢4w ago
so i jsut used public url šŸ˜° dthat dont feel right
Faith
FaithOPā€¢4w ago
No description
Faith
FaithOPā€¢4w ago
found in his read.me on github
Brody
Brodyā€¢4w ago
you do not need to use the public url, that is purely for example
Faith
FaithOPā€¢4w ago
TCP PRXY? bro šŸ˜­
Brody
Brodyā€¢4w ago
have you followed the guide?
Faith
FaithOPā€¢4w ago
yes ong what am i doing worng
Brody
Brodyā€¢4w ago
lets see your scripts
Faith
FaithOPā€¢4w ago
i dont need all the scripts only run-app
#!/bin/bash
# Make sure this file has executable permissions, run `chmod +x run-app.sh`

# Build assets using NPM
npm run build

# Clear cache
php artisan optimize:clear

# Cache the various components of the Laravel application
php artisan config:cache
php artisan event:cache
php artisan route:cache
php artisan view:cache
php artisan filament:optimize
php artisan filament:optimize-clear
php artisan storage:link
php artisan optimize



# Run any database migrations
php artisan migrate --force
#!/bin/bash
# Make sure this file has executable permissions, run `chmod +x run-app.sh`

# Build assets using NPM
npm run build

# Clear cache
php artisan optimize:clear

# Cache the various components of the Laravel application
php artisan config:cache
php artisan event:cache
php artisan route:cache
php artisan view:cache
php artisan filament:optimize
php artisan filament:optimize-clear
php artisan storage:link
php artisan optimize



# Run any database migrations
php artisan migrate --force
i mean dont think this is wrong i just addedd a few things filament and storage:link and optimize
Brody
Brodyā€¢4w ago
okay and have you told railway to run that as the start script?
Faith
FaithOPā€¢4w ago
No description
Faith
FaithOPā€¢4w ago
yessir for some reason on hist github his is start.sh
Faith
FaithOPā€¢4w ago
No description
Faith
FaithOPā€¢4w ago
he dont have the one in the article
Brody
Brodyā€¢4w ago
ill talk with the creator
Faith
FaithOPā€¢4w ago
imma copy his and try again from github lol switch to ur mariadb template and works https://api-app-production-8da9.up.railway.app/ we up gangy
Brody
Brodyā€¢4w ago
you are using the public url
Faith
FaithOPā€¢4w ago
yea should i do private instead
Brody
Brodyā€¢4w ago
of course
Faith
FaithOPā€¢4w ago
okidoki
Brody
Brodyā€¢4w ago
but its not going to work with how you currently have it setup
Faith
FaithOPā€¢4w ago
its working wdym what are you seeing that im not šŸ‘€
Brody
Brodyā€¢4w ago
its working with the public url
Faith
FaithOPā€¢4w ago
yea im changing it now
Brody
Brodyā€¢4w ago
the private url is not going to work with how you currently have it setup
Faith
FaithOPā€¢4w ago
oh you right im in the same circle šŸ’€ bro im so cooked 3 am i just wanted to do this for fun now im dying insde
Brody
Brodyā€¢4w ago
^ you can use the public url for now
Faith
FaithOPā€¢4w ago
okeeyy thanks for the help !
Prosper
Prosperā€¢4w ago
Hey @Faith I am glad you got it resolved. For the private url thing, I'll come back to you with some ways to make it work
Faith
FaithOPā€¢4w ago
Thank you @Prosper
Faith
FaithOPā€¢3w ago
thanks
Brody
Brodyā€¢3w ago
Did this get you up and running using the private url?
Want results from more Discord servers?
Add your server