R
RailwayThomas Mendonça

Build PHP 7.3 with Laravel. How can i do it?

I have an old application. How can i make build in service?
No description
P
Percy15d ago
Project ID: N/A
TM
Thomas Mendonça15d ago
N/A Project ID: N/A
B
Brody15d ago
You would need to write a Dockerfile to use unsupported php versions
TM
Thomas Mendonça15d ago
Okay. I need a Dockerfile. Have a application, but i have questions about how make it. Can send me?
M
Medim15d ago
@Thomas Mendonça are you brazilian? if so, do you mind upvoting this community suggestion ? Bora trazer o Railway pro Brasil 😉 Also, I'll send you a dockerfile example Do you use Composer or Artisan?
TM
Thomas Mendonça15d ago
Both Yeah!! I am Brazilian ❤️ I need composer run my Laravel project
M
Medim15d ago
Ok, one sec
TM
Thomas Mendonça15d ago
Okay
M
Medim15d ago
This is my dockerfile using php 7.4 and composer
FROM composer:2.4.4 AS composer
FROM php:7.4-fpm as base
COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

#UPDATE
RUN apt-get update

#INSTALL DEPS
RUN apt-get install -y \
nginx \
supervisor \
zlib1g-dev \
libzip-dev \
libjpeg-dev \
libxml2-dev \
libonig-dev \
libicu-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev

#SETUP PHP EXTENSIONS
RUN docker-php-ext-install gd soap zip intl
RUN docker-php-ext-configure gd --with-freetype --with-jpeg

FROM base as config

#COPY NGINX AND SUPERVISOR CONF
COPY default.conf /etc/nginx/conf.d/default.conf
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

FROM config as app

WORKDIR /var/www/html

COPY . .

RUN composer install --ignore-platform-req=ext-bcmath --no-dev

EXPOSE 8080
CMD ["/usr/bin/supervisord"]
FROM composer:2.4.4 AS composer
FROM php:7.4-fpm as base
COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

#UPDATE
RUN apt-get update

#INSTALL DEPS
RUN apt-get install -y \
nginx \
supervisor \
zlib1g-dev \
libzip-dev \
libjpeg-dev \
libxml2-dev \
libonig-dev \
libicu-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev

#SETUP PHP EXTENSIONS
RUN docker-php-ext-install gd soap zip intl
RUN docker-php-ext-configure gd --with-freetype --with-jpeg

FROM base as config

#COPY NGINX AND SUPERVISOR CONF
COPY default.conf /etc/nginx/conf.d/default.conf
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

FROM config as app

WORKDIR /var/www/html

COPY . .

RUN composer install --ignore-platform-req=ext-bcmath --no-dev

EXPOSE 8080
CMD ["/usr/bin/supervisord"]
default.conf
server {
listen 8080;
server_name 0.0.0.0;
root /var/www/html;
# pass the PHP scripts to FastCGI server
# listening on 127.0.0.1:9000

location / {
try_files $uri /public/index.php?q=$uri&$args;
}

# comment vv
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
include fastcgi_params;
}
}
server {
listen 8080;
server_name 0.0.0.0;
root /var/www/html;
# pass the PHP scripts to FastCGI server
# listening on 127.0.0.1:9000

location / {
try_files $uri /public/index.php?q=$uri&$args;
}

# comment vv
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
include fastcgi_params;
}
}
supervisor.conf
nodaemon=true

[program:nginx]
command=nginx -g "daemon off;"
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

[program:php-fpm]
command=php-fpm
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
nodaemon=true

[program:nginx]
command=nginx -g "daemon off;"
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

[program:php-fpm]
command=php-fpm
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
this is also an old project, lol It just doesn't has artisan
TM
Thomas Mendonça15d ago
Okay I will try here Need I to config something in Railway settings?
B
Brody15d ago
you shouldn't have to
TM
Thomas Mendonça15d ago
okay
TM
Thomas Mendonça15d ago
No description
TM
Thomas Mendonça15d ago
Error 😢
B
Brody15d ago
TM
Thomas Mendonça15d ago
M
Medim15d ago
change php:7.4-fpm to php:7.3-fpm There's some incompatibilities between the two
This new minor version brings with it a number of new features and a few incompatibilities that should be tested for before switching PHP versions in production environments.
This new minor version brings with it a number of new features and a few incompatibilities that should be tested for before switching PHP versions in production environments.
TM
Thomas Mendonça15d ago
Okay, one sec
TM
Thomas Mendonça15d ago
error
No description
B
Brody15d ago
build logs again please
TM
Thomas Mendonça15d ago
TM
Thomas Mendonça15d ago
There is, my bro
B
Brody15d ago
im not the php guy, you will have to wait for a response from medim, please be patient as this is community support
M
Medim15d ago
replace it to php:7.3-fpm-alpine i'm wondering if docker-ext exists in php:7.3-fpm by default 🤔 im sure the alpine one does tho
TM
Thomas Mendonça15d ago
okay, one sec haha no problem, I will wait. thanks for you help
TM
Thomas Mendonça15d ago
No description
TM
Thomas Mendonça15d ago
hehe fail again :"(
B
Brody15d ago
going forward, please only send the logs you get from the bookmarklet, the screenshots are not very helpful
M
Medim15d ago
alpine doesn't has apt-get lmao wait a sec
TM
Thomas Mendonça15d ago
Ow, okay.
M
Medim15d ago
one sec, i'm redoing the dockerfile to be alpine based
FROM composer:2.4.4 AS composer
FROM php:7.3-fpm-alpine as base
COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

#INSTALL DEPS
RUN apk update && \
apk add --no-cache \
nginx \
supervisor \
zlib-dev \
libzip-dev \
libjpeg-turbo-dev \
libpng-dev \
freetype-dev \
libxml2-dev \
oniguruma-dev \
icu-dev

#SETUP PHP EXTENSIONS
RUN docker-php-ext-install gd soap zip intl
RUN docker-php-ext-configure gd --with-freetype --with-jpeg

FROM base as config

#COPY NGINX AND SUPERVISOR CONF
COPY default.conf /etc/nginx/conf.d/default.conf
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

FROM config as app

WORKDIR /var/www/html

COPY . .

RUN composer install --ignore-platform-req=ext-bcmath --no-dev

EXPOSE 8080
CMD ["/usr/bin/supervisord"]
FROM composer:2.4.4 AS composer
FROM php:7.3-fpm-alpine as base
COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

#INSTALL DEPS
RUN apk update && \
apk add --no-cache \
nginx \
supervisor \
zlib-dev \
libzip-dev \
libjpeg-turbo-dev \
libpng-dev \
freetype-dev \
libxml2-dev \
oniguruma-dev \
icu-dev

#SETUP PHP EXTENSIONS
RUN docker-php-ext-install gd soap zip intl
RUN docker-php-ext-configure gd --with-freetype --with-jpeg

FROM base as config

#COPY NGINX AND SUPERVISOR CONF
COPY default.conf /etc/nginx/conf.d/default.conf
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

FROM config as app

WORKDIR /var/www/html

COPY . .

RUN composer install --ignore-platform-req=ext-bcmath --no-dev

EXPOSE 8080
CMD ["/usr/bin/supervisord"]
let's see the next error lmao (it prob won't gonna find one of those packages since i migrated debian to alpine-linux)
TM
Thomas Mendonça15d ago
ok one minute
TM
Thomas Mendonça15d ago
No description
TM
Thomas Mendonça15d ago
M
Medim15d ago
💀 what is weird is that it runs the docker-php-ext in line 21 but no the one that configures gd you can try removing that line entirely if your app doesn't rely on gd or try changing it to
RUN docker-php-ext-configure gd \
--with-freetype \
--with-png \
--with-jpeg
RUN docker-php-ext-configure gd \
--with-freetype \
--with-png \
--with-jpeg
TM
Thomas Mendonça15d ago
okay what's gd?
M
Medim15d ago
Image manipulation
TM
Thomas Mendonça15d ago
Ah okay one sec
TM
Thomas Mendonça15d ago
No description
M
Medim15d ago
whitespaces?
B
Brody15d ago
^
M
Medim15d ago
tbh just remove that entire line if its needed we'll find a way to add it lets get that app up first
TM
Thomas Mendonça15d ago
Okay
M
Medim15d ago
FROM composer:2.4.4 AS composer
FROM php:7.3-fpm-alpine as base
COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

#INSTALL DEPS
RUN apk update && \
apk add --no-cache \
nginx \
supervisor \
zlib-dev \
libzip-dev \
libjpeg-turbo-dev \
libpng-dev \
freetype-dev \
libxml2-dev \
oniguruma-dev \
icu-dev

#SETUP PHP EXTENSIONS
RUN docker-php-ext-install soap zip intl

FROM base as config

#COPY NGINX AND SUPERVISOR CONF
COPY default.conf /etc/nginx/conf.d/default.conf
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

FROM config as app

WORKDIR /var/www/html

COPY . .

RUN composer install --ignore-platform-req=ext-bcmath --no-dev

EXPOSE 8080
CMD ["/usr/bin/supervisord"]
FROM composer:2.4.4 AS composer
FROM php:7.3-fpm-alpine as base
COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

#INSTALL DEPS
RUN apk update && \
apk add --no-cache \
nginx \
supervisor \
zlib-dev \
libzip-dev \
libjpeg-turbo-dev \
libpng-dev \
freetype-dev \
libxml2-dev \
oniguruma-dev \
icu-dev

#SETUP PHP EXTENSIONS
RUN docker-php-ext-install soap zip intl

FROM base as config

#COPY NGINX AND SUPERVISOR CONF
COPY default.conf /etc/nginx/conf.d/default.conf
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

FROM config as app

WORKDIR /var/www/html

COPY . .

RUN composer install --ignore-platform-req=ext-bcmath --no-dev

EXPOSE 8080
CMD ["/usr/bin/supervisord"]
TM
Thomas Mendonça15d ago
M
Medim15d ago
almost there, lol
TM
Thomas Mendonça15d ago
hehe yeah more one
M
Medim15d ago
FROM composer:2.4.4 AS composer
FROM php:7.3-fpm-alpine as base
COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

#INSTALL DEPS
RUN apk update && \
apk add --no-cache \
nginx \
supervisor \
zlib-dev \
libzip-dev \
libjpeg-turbo-dev \
libpng-dev \
freetype-dev \
libxml2-dev \
oniguruma-dev \
icu-dev \
git

#SETUP PHP EXTENSIONS
RUN docker-php-ext-install soap zip intl

FROM base as config

#COPY NGINX AND SUPERVISOR CONF
COPY default.conf /etc/nginx/conf.d/default.conf
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

FROM config as app

WORKDIR /var/www/html

COPY . .

RUN composer install --ignore-platform-req=ext-bcmath --no-dev

EXPOSE 8080
CMD ["/usr/bin/supervisord"]
FROM composer:2.4.4 AS composer
FROM php:7.3-fpm-alpine as base
COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

#INSTALL DEPS
RUN apk update && \
apk add --no-cache \
nginx \
supervisor \
zlib-dev \
libzip-dev \
libjpeg-turbo-dev \
libpng-dev \
freetype-dev \
libxml2-dev \
oniguruma-dev \
icu-dev \
git

#SETUP PHP EXTENSIONS
RUN docker-php-ext-install soap zip intl

FROM base as config

#COPY NGINX AND SUPERVISOR CONF
COPY default.conf /etc/nginx/conf.d/default.conf
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

FROM config as app

WORKDIR /var/www/html

COPY . .

RUN composer install --ignore-platform-req=ext-bcmath --no-dev

EXPOSE 8080
CMD ["/usr/bin/supervisord"]
it installs from source, we need git
TM
Thomas Mendonça15d ago
RUN apk update && apk add --no-cache again? twice?
M
Medim15d ago
edited it, forgot to remove that line
TM
Thomas Mendonça15d ago
ah okay
M
Medim15d ago
also, do you got the default.conf and supervisord.conf at the same dir level as your dockerfile?
TM
Thomas Mendonça15d ago
yes, i do building...
TM
Thomas Mendonça15d ago
M
Medim15d ago
yeah it needs gd lmao
TM
Thomas Mendonça15d ago
Oh God And now?
M
Medim15d ago
FROM composer:2.4.4 AS composer
FROM php:7.3-fpm-alpine as base
COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

#INSTALL DEPS
RUN apk update && \
apk add --no-cache \
nginx \
supervisor \
zlib-dev \
libzip-dev \
libjpeg-turbo-dev \
libpng-dev \
freetype-dev \
libxml2-dev \
oniguruma-dev \
icu-dev \
git

#SETUP PHP EXTENSIONS
RUN docker-php-ext-install gd soap zip intl
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/

FROM base as config

#COPY NGINX AND SUPERVISOR CONF
COPY default.conf /etc/nginx/conf.d/default.conf
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

FROM config as app

WORKDIR /var/www/html

COPY . .

RUN composer install --ignore-platform-req=ext-bcmath --no-dev

EXPOSE 8080
CMD ["/usr/bin/supervisord"]
FROM composer:2.4.4 AS composer
FROM php:7.3-fpm-alpine as base
COPY --from=composer /usr/bin/composer /usr/bin/composer
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

#INSTALL DEPS
RUN apk update && \
apk add --no-cache \
nginx \
supervisor \
zlib-dev \
libzip-dev \
libjpeg-turbo-dev \
libpng-dev \
freetype-dev \
libxml2-dev \
oniguruma-dev \
icu-dev \
git

#SETUP PHP EXTENSIONS
RUN docker-php-ext-install gd soap zip intl
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/

FROM base as config

#COPY NGINX AND SUPERVISOR CONF
COPY default.conf /etc/nginx/conf.d/default.conf
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

FROM config as app

WORKDIR /var/www/html

COPY . .

RUN composer install --ignore-platform-req=ext-bcmath --no-dev

EXPOSE 8080
CMD ["/usr/bin/supervisord"]
re added GD with some php 7.2 args this help thread made my remember my hate for php in prod also, good thing railway doesn't charge build time
TM
Thomas Mendonça15d ago
Yeah hehe So good
TM
Thomas Mendonça15d ago
TM
Thomas Mendonça15d ago
error
M
Medim15d ago
you are using a github repo as package in composer
M
Medim15d ago
No description
M
Medim15d ago
hmm..
TM
Thomas Mendonça15d ago
okay i will remove one minute
M
Medim15d ago
is it needed? seems like its a private repo and its a hassle since you would need to generate SSH keys just to clone them with composer but its a bad idea to upload your SSH keys to your repo so you would need repo secrets... so lets avoid all that
TM
Thomas Mendonça15d ago
i will remove, it is trash
M
Medim15d ago
..did it build?
TM
Thomas Mendonça15d ago
build complete but don't show the default page
M
Medim15d ago
prob some nginx config
TM
Thomas Mendonça15d ago
I how put "/public"? to publish
M
Medim15d ago
@Brody I set a 8080 port in my server.listen so I guess he would need to add a PORT=8080 env var? . @Thomas Mendonça create a PORT=8080 env var
TM
Thomas Mendonça15d ago
Oooh this is the problem !!
M
Medim15d ago
we may need to mess a bit with the default.conf now, since I use that specific config to fastcgi
TM
Thomas Mendonça15d ago
one minute i will set port ah fail
TM
Thomas Mendonça15d ago
No description
TM
Thomas Mendonça15d ago
M
Medim15d ago
no errors just wait try refreshing it
TM
Thomas Mendonça15d ago
i do it
M
Medim15d ago
:thonking: can you send the url here?
B
Brody15d ago
Thomas, where did you set the env var
M
Medim15d ago
(I also think there's some issues with the default.conf)
B
Brody15d ago
would you mind answering this question can you please answer the question
M
Medim15d ago
Did u set it in the Railway Env tab or locally?
TM
Thomas Mendonça15d ago
in the railway system variables
M
Medim15d ago
No description
TM
Thomas Mendonça15d ago
Railway env tab Railway env tab
M
Medim15d ago
@Brody would it be too hard to migrate from nginx to caddy?
B
Brody15d ago
if you where familiar with the technologies involved, no
M
Medim15d ago
try this default.conf
server {
listen 8080;
server_name 0.0.0.0;
root /var/www/html/public; # Adjust the root directory to point to the public directory of your Laravel app

location / {
try_files $uri $uri/ /index.php?$query_string;
}

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
server {
listen 8080;
server_name 0.0.0.0;
root /var/www/html/public; # Adjust the root directory to point to the public directory of your Laravel app

location / {
try_files $uri $uri/ /index.php?$query_string;
}

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
laravel serves in the /public folder saw you mentioning it, I forgot about that
TM
Thomas Mendonça15d ago
Okay Building... One minute nothing yet "fastcgi_pass 127.0.0.1:9000;" Is it right?
M
Medim15d ago
Anything in the logs?
TM
Thomas Mendonça15d ago
M
Medim15d ago
yes. I'm out of ideas :PepeCRY: we got it to build and deploy but I suck at nginx
TM
Thomas Mendonça15d ago
Ahh :/ So close
M
Medim15d ago
https://laravel.com/docs/11.x/deployment#nginx we can try the default conf from laravel docs
server {
listen 8080;
listen [::]:8080;
server_name 0.0.0.0;
root /var/www/html/public;

add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";

index index.php;

charset utf-8;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }

error_page 404 /index.php;

location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}

location ~ /\.(?!well-known).* {
deny all;
}
}
server {
listen 8080;
listen [::]:8080;
server_name 0.0.0.0;
root /var/www/html/public;

add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";

index index.php;

charset utf-8;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }

error_page 404 /index.php;

location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}

location ~ /\.(?!well-known).* {
deny all;
}
}
TM
Thomas Mendonça15d ago
okay One minute
TM
Thomas Mendonça15d ago
M
Medim15d ago
That's normal, just supervisord starting things up
TM
Thomas Mendonça15d ago
Yeah But same page Application failed to respond https://nepscoin-sistema-production.up.railway.app/
M
Medim15d ago
:sadcat:
TM
Thomas Mendonça15d ago
ô sufoco very difficult
TM
Thomas Mendonça15d ago
TM
Thomas Mendonça15d ago
I was set this default.conf
TM
Thomas Mendonça15d ago
Now is play life
No description
TM
Thomas Mendonça15d ago
Now is the problem
B
Brody15d ago
English only please
TM
Thomas Mendonça15d ago
Sorry Someone help me?
M
Medim15d ago
U are now listening to port 80 So that env var u set at railway should also be 80 but if it works I guess u alrady did that But seems like file serving is still a bit off since it says 404 Is it an API? you can try doing a request to it
TM
Thomas Mendonça14d ago
Yeah, railway service on port 80 env Web but not API I managed to find an error on port 9000, already in use. With this information, can you help me with any solution tips?
M
Medim14d ago
Its already in use by the fastcgi oh nvm, u changed it to 80 fastcgi port can't be the same as your listen port afaik, so put like listen on 80 and fastcgi port on a number > 1000 and what did u do to hit that error? maybe that was the error this entire time, try changing it to like 8080, also you cannot use fastcgi as a unix socket, last time I used it like this on railway it wouldn't work pecause of specific perms. it needs to be on a port @Thomas Mendonça send ur default.conf here for me to edit it
TM
Thomas Mendonça14d ago
M
Medim14d ago
just change the listen to listen 80; (also change the env var in railway to 80)
TM
Thomas Mendonça14d ago
i'm trying run local not success can you analize, please?
M
Medim14d ago
that default conf won't work locally that's railway specific
TM
Thomas Mendonça14d ago
TM
Thomas Mendonça14d ago
the same problem, if run docker local, run in railway
M
Medim14d ago
to run locally: change server_name to localhost to run on railway: change server_name to 0.0.0.0
TM
Thomas Mendonça14d ago
Aah okay But the nginx, the same is error?
M
Medim14d ago
404?
TM
Thomas Mendonça14d ago
yeah not found the app
M
Medim14d ago
yeah, I don't know what to do anymore lmao
TM
Thomas Mendonça14d ago
okay one minute i will try
F
Faith14d ago
Hey idk if this will help at allll BUT i also use laravel on railway and these are my build cmds
composer install && php artisan optimize:clear && php artisan migrate --force && php artisan storage:link
composer install && php artisan optimize:clear && php artisan migrate --force && php artisan storage:link
its under Custom Build Command and just put this in i dont use any form of changes than those cmds, no custom railway conf or anything
TM
Thomas Mendonça14d ago
Okay What's PHP version? @Faith
F
Faith14d ago
its 8.2, it auto does it im using nixpacks
TM
Thomas Mendonça14d ago
Good Mine 7.3 😢 Knows someone how run PHP 7.3?
F
Faith14d ago
a guy further up gave a composer with 7.3 try his
TM
Thomas Mendonça14d ago
im try all nothing that solved Guys, I come to you to let you know that it worked! It was difficult, but I managed to solve it. If you want, I'll put the 3 files here. I am very grateful to those who helped me and spent time working with me to resolve it. A special hug to @Medim , who was great!
M
Medim14d ago
Share them here @Thomas Mendonça So I can see what I missed
TM
Thomas Mendonça14d ago
Want results from more Discord servers?
Add your server
More Posts
TLS certificate has taken over 24 hours for a custom domainI have 2 custom domains - 1 using a subdomain and 1 using the root. The one on the subdomain is workRedis For Vector Search (GenAI)I have Redis database deployed on Railways Pro plan. I want to add LLM Retrieval Augmented GeneratioWhat is the best way to install private npm packages?My usecase is that my node app needs to install a package from a private github registry. What I wouCron job not running at specific timeHi I have a cron job that should run every hour 0 * * * *. For some reason, it skips runs sometimHow much is Railways scalable?Is there any information how much it is scalable in reality? According to the price, can the serviceCORS Policy problem with backboard.railway.app/graphqlI'm getting a CORS error in my console when using the Railway dashboard. ``` Access to fetch at 'hOutbound ip addressesHi, what are railway's outbound ip addressesBest way to setup back up system for my postgres?Looking to do a backup every X number of hoursRailway <> Hetzner servers cant communicateWe had a deployment running succesfully for the last week today, the railway instances cant communihow to remove docker cache ?it is always just using cache, and not rebuilding correclyDeployment HelpApologies i have 3 things to deploy and i dont know how to do itCannot Access Railway APIJust noticed that I am unable to access the full public API and the GraphQL Playground isn't workingHow do I create a config file?In the [documentation](<https://docs.railway.app/guides/config-as-code>) for Railway configuration fRedis Connection FailureProject ID: d09cd450-b0ba-483f-ae0c-5e329305f433 Redis is refusing connnections.504 Gateway Timeout issueAll of a sudden my production application starts throwing up 504 error. There are no error logs and Vite React ThreejsI copy nixpacks.toml and Caddyfile from this repository <https://github.com/brody192/vite-react-temSQLalchemy could not translate host name "postgres.railway.internal"Basically I'm making a engine with env var stored in DATABASE_PRIVATE_URL that references my PostgreHobby plan timeoutRailway returns a 503 Application failed to respond after 30s, it used to be 5 minutes. Can this be time zoneHow to configure the time zone for my project so that it is UTC-5, which is from Lima, or I have alssubscription didn't charged automaticallyHi, I have my card saved on railway and it didn't charged me automatically, should i wait for this o