#Deploying laravel

68 messages · Page 1 of 1 (latest)

pure sun
#

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

graceful coralBOT
#

Project ID: 3eeeee07-630f-4d9a-8a7c-4d98d84e0d34

gloomy finch
pure sun
# gloomy finch I would recommend checking out our guide - <https://docs.railway.app/guides/lara...

"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

gloomy finch
#

during build?

pure sun
#
DB_CONNECTION="mariadb"
DB_HOST="database.railway.internal"
DB_PORT="3306"
DB_DATABASE="cvr-api"
DB_USERNAME="root"
DB_PASSWORD="7aj6hwcmcbwq83u5"
#

yea

gloomy finch
#

because the private network is not available during the build, please read the guide to see how to get around that

pure sun
#

okay thank you sir

#

"
You will need to bind to a IPv6 port to receive traffic on the private network.
"

#

right

gloomy finch
#

no, please read the entire guide

pure sun
#

😭 i cant find what ur talking abotut bro

gloomy finch
pure sun
#

so i jsut used public url 😰

#

dthat dont feel right

gloomy finch
#

you do not need to use the public url, that is purely for example

pure sun
#

TCP PRXY?

#

bro 😭

gloomy finch
#

have you followed the guide?

pure sun
#

yes ong what am i doing worng

gloomy finch
#

lets see your scripts

pure sun
#

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
#

i mean dont think this is wrong i just addedd a few things

#

filament and storage:link and optimize

gloomy finch
#

okay and have you told railway to run that as the start script?

pure sun
#

yessir

#

for some reason on hist github his is start.sh

#

he dont have the one in the article

gloomy finch
#

ill talk with the creator

pure sun
#

imma copy his and try again

#

from github

#

lol

#

switch to ur mariadb template and works

#

we up gangy

gloomy finch
#

you are using the public url

pure sun
#

yea

#

should i do private instead

gloomy finch
#

of course

pure sun
#

okidoki

gloomy finch
#

but its not going to work with how you currently have it setup

pure sun
#

its working wdym

#

what are you seeing that im not 👀

gloomy finch
#

its working with the public url

pure sun
#

yea im changing it now

gloomy finch
#

the private url is not going to work with how you currently have it setup

pure sun
#

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

gloomy finch
#

you can use the public url for now

pure sun
#

okeeyy thanks

#

for the help !

karmic yoke
#

Hey @pure sun 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

pure sun
#

Thank you @karmic yoke

karmic yoke
pure sun
#

thanks