gregorip02
Laravel app: permission denied to write on mounted volume
Because I'm using a docker image that by default runs as a non-privileged user
www-data:www-data
or 33:33
, it's necessary to change the owner of the mounted volume after starting the container.
To achieve this, I added a script in /etc/entrypoint.d/99-starting-hook.sh
with the following content:
This is my final Dockerfile:
There is no need to add the RAILWAY_RUN_UID=0
environment variable because the volume is already owned by the www-data
user.
If you are using serversideup/php:8.3-unit
you must add the following environment variable:
AUTORUN_ENABLED=true
This will run php artisan storage:link
after starting the container.16 replies
I can't access my MySQL database using the private network.
It just worked, I moved the "php artisan optimize" command which caches the configuration (includes the DB credentials) and maybe it was pointing to a non-existent database at the execution stage.
26 replies
I can't access my MySQL database using the private network.
I don't have the host resolution issue, but apparently there is a restriction for a query in the migration:
SQLSTATE[HY000] [2002] Connection refused (Connection: mysql, SQL: select table_name as
name
, (data_length + index_length) as size
, table_commentas comment
, engine as engine
, table_collation as collation
from information_schema.tables where table_schema = 'forge' and table_type in ('BASETABLE', 'SYSTEM VERSIONED') order by table_name)26 replies
I can't access my MySQL database using the private network.
I tried it but it still has the same problem, in fact, minutes after the deployment I tried to execute:
railway run sh -c "ping mysql.railway.internal"
but I get:
"ping: cannot resolve mysql.railway.internal: Unknown host"
26 replies