DEV Community

Cover image for How to get WordPress running with Docker

How to get WordPress running with Docker

Michael "lampe" Lazarski on April 30, 2019

🚀Prerequirments You need to have 🐳Docker installed. How you install docker heavily depends on your operating system. 🤔Choosing...
Collapse
 
devellopah profile image
Islam Ibakaev • Edited

Beatiful article, dude. Btw, wordpress image volume can be shorten to

 volumes:
   - .:/var/www/html
Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

Thanks, dude :)

Yeah, it could! Thanks :)

Collapse
 
kyletozer profile image
Kyle Tozer

I'm finding that I am not as easily able to edit the files in my bind mount on the host as you are. After running docker-compose up, I try to make changes to my site files and keep getting permissions errors in my IDE, is there a way around this? My docker-compose.yml file looks almost exactly like yours. Thanks!

Collapse
 
juslintek profile image
Linas

I would not suggest it that way. Its better to isolate http,php layers. Now they are cramed up in a single docker layer named wordpress. Why is that because you can test performance with different http services at the same time. As well usually you'd know which layer ir responsible for server side problems. Am I wrong?

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

I don't fully understand what you mean.

This is based on the offical WordPress docker image.

Also it is a setup for development.

Why should I at this point care about the http performance?

If I want to have something that scales I can just spin up multiple instances of the docker image.

You get the usual logs as with every service so you could just look into the logs.

For me this is the wrong point in time to think about http performance but we can have a talk about that.

Collapse
 
venelinn profile image
Venelin

Nice article!
But you can also install Lando and use Wordpress recipe. I guess the performance should be the same since Lando uses Docker !

Collapse
 
shry profile image
shry

I have developed an open-source project called wordup on GitHub,
which is a development tool only for WordPress.
You can also setup a docker-compose based stack in a matter of seconds, export your project and much more.

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

Didn't know about Lando. I will have a look at it.

Thanks for the great comment.

Have a fantastic day.

Collapse
 
dendihandian profile image
Dendi Handian

Everyone should use bedrock version of Wordpress. It's development-friendly.

Collapse
 
vanaf1979 profile image
Stephan Nijman

This may be of interest to you! Gutenberg Local Environment Rewrite make.wordpress.org/core/2019/08/30...