You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Having problems when using the latest wordpress docker image #10
Recently been using render.com as the main cloud hosting platform for the company I'm currently working in. We liked render so much and we're now migrating our wordpress landing websites to render. We followed the one click deploy as defined in render's documentation: https://render.com/docs/deploy-wordpress. It deployed smoothly however we need to tweak some of the parts in the Dockerfile most specifcally the wordpress docker image version being used in the template. The current version used is wordpress:5.3.2-apache which a bit old and prone for security concerns. We forked this repository and updated the said dockerfile: https://github.com/kyleaquino/render-wordpress
Now the issue we tried using the latest image wordpress:6.2.0-apache and synced it to our render account. When it attempted to deploy and run the latest image it gives us a 403 Forbidden Error caused by wordpress not being found in /var/www/html directory. we tried different approaches like injecting a wordpress tarball folder into the /var/www/html directory but still gives the same problem.
One bruteforce way we do it is to deploy the original template with the older wordpress image. then update the dockerfile to the latest wordpress version and redeploy.
Is there a better way to do this? Right now we have to constantly change the docker file when deploying new instances of the wordpress server.
In the docker file remove or comment out the last line: USER www-data:www-data
not sure why this isn't an issue when running the template but when you read the logs right before it fails it's trying to change permissions on a directory... the www-data user can't do this so the deployment fails. Maybe this is a change in the newer versions of the WordPress container.
the only reason I can tell that you would need this line is if you are shelling into the container on render and you are creating files/folders the www-data(WordPress user) user might not have access to that file/folder unless you run a chown on that file/directory to make www-data the owner and also maybe the group as well (chown www-data:www-data). (ie WordPress wouldn't be able to see that file unless you did a chown )
I haven't vetted this solution fully, so if you're finding missing assets in your WordPress or weird errors when you implement this solution, it would be because the www-data user doesn't have access to it.
Activity
sanjaydotpro commentedon May 4, 2023
having the same issue. I checked the logs and looks like this is the issue:
tar: .: Cannot change mode to rwxrwxr-x: Operation not permittedjakebd commentedon Feb 23, 2024
In the docker file remove or comment out the last line: USER www-data:www-data
not sure why this isn't an issue when running the template but when you read the logs right before it fails it's trying to change permissions on a directory... the www-data user can't do this so the deployment fails. Maybe this is a change in the newer versions of the WordPress container.
the only reason I can tell that you would need this line is if you are shelling into the container on render and you are creating files/folders the www-data(WordPress user) user might not have access to that file/folder unless you run a chown on that file/directory to make www-data the owner and also maybe the group as well (chown www-data:www-data). (ie WordPress wouldn't be able to see that file unless you did a chown )
I haven't vetted this solution fully, so if you're finding missing assets in your WordPress or weird errors when you implement this solution, it would be because the www-data user doesn't have access to it.
Hope this helps, this also gave me a headache.