Wordpress + volumes issues
madebyjonny
HOBBYOP

2 years ago

I am having an issue getting the volumes to work with Wordpress.
I chose not to use the existing template or Docker as I want to be able to work on the theme / deploy it through a git workflow vs manually uploading changes each time.

So I have a repo with Wordpress in which I am deploying to Railway which works fine. The last part is needing to hook up the volume so I can persist the uploads from the media library. I have tried making the path /app/wp-content , /app/wp-content & also setting up a custom path to an upload directory.

Each time I get errors where Wordpress is unable to write to this directory when trying to upload. I have also tried adding RAILWAY_RUN_UID=0.

In Wordpress I see "Unable to create directory wp-content/uploads/2024/09. Is its parent directory writable by the server?". I can't see anything in the Railway logs that hints at why this might be.

I feel like I am missing something simple here, but if anyone can point me in the right direction that would be great.

4 Replies

2 years ago

Hello, having the service is incredibly helpful!

I see that you are simply trying to deploy a folder that consists of a wordpress install, and while this does get correctly detected as php and will work to some extent, nixpacks was never meant to handle this scenario.

The solution would be to write a Dockerfile that runs the WordPress install as this is not something nixpacks is suited for, this will also solve the volume permission issue.


madebyjonny
HOBBYOP

2 years ago

Okay cool, I thought this might be the case. Thanks for confirming.


2 years ago

No problem! Wish I could help you further but I don't have enough experience with WordPress.


madebyjonny
HOBBYOP

2 years ago

I think what I want to do may not be possible with Railway. I originally I went down the docker path, but couldn't see how I could copy the wp-content directory without it adding un-needed complexity for my goal (simple setup for smaller sites). This was just an experiment to see if this would be possible anyway.

Thanks again


Loading...