DEV Community

How to use Docker for easy and fast WordPress development

Francesco Napoletano on July 18, 2018

A while ago I used to do my WordPress development using this "vagrant-based" environment. It's very well written, opensource and comes with whateve...
Collapse
 
marvelouswololo profile image
MarvelousWololo

what about user permissions for the local /wp-content/?

Collapse
 
lukff profile image
Lucas Fernandes

Would like to know how to solve it

Collapse
 
napolux profile image
Francesco Napoletano

Well, if you have problems, go with 777 and be happy :P

I don't have any problem, my folder is at 644

Thread Thread
 
marvelouswololo profile image
MarvelousWololo

bro go with 777 is almost always a terrible idea. :(

Thread Thread
 
napolux profile image
Francesco Napoletano

It is in general. Probably not in this specific case ;-)

Thread Thread
 
iwasherefirst2 profile image
Adam Nielsen • Edited

I have the same issue. The files are all owned by www-data:www-data and have permission 644 - I don't have permissions to edit/create because my user is adam and even if I add me to group www-data I won't get access. Any advice? And how would you do it with 777 permission? Would you change the permission each time you create a new file?

Collapse
 
shry profile image
shry
Collapse
 
pwkip profile image
Jules Colle • Edited

Awesome! I love

  • how small this is
  • how it only keeps the wp-content folder in the file system (after 10 years of WP development this is the first time I find a dev example that encourages me to only place the wp-content folder under version control.)

Spotted 1 small error: your last two lines should be

volumes:
  db_data:

and not

volumes:
db_data:

otherwise it won't build. It's fine in your git repo though.

I agree that the 777 file permission is totally fine here. After all it's supposed to be a local dev environment.

Collapse
 
napolux profile image
Francesco Napoletano

Fixed, thanks!

Collapse
 
fy09 profile image
fy • Edited

Not sure what useful info have you added in this post. The same but in more details can be found here
hub.docker.com/_/wordpress/

Collapse
 
mphat1000 profile image
mp10

I have error

ERROR: for wordpress-local_db_1 Cannot start service db: b'Mounts denied: EOF'

ERROR: for db Cannot start service db: b'Mounts denied: EOF'
ERROR: Encountered errors while bringing up the project.

Collapse
 
mphat1000 profile image
mp10

Hi. I have an error
MySQL Connection Error: (1130) Host '172.18.0.3' is not allowed to connect to this MySQL server

Collapse
 
chrisueda profile image
Christopher Ueda

This is the first docker/Wordpress tutorial/repo that has worked for me on the first try! Thanks!