Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are the WordPress files with Docker?

I'm getting started with running Docker on MacOS and I just was able to install a WordPress container and get that running locally. But where the heck are the actual WordPress files?

Do I need to SSH into the container so I can view/edit them there? If so, how would one go about that?

like image 840
ultraloveninja Avatar asked Apr 24 '18 13:04

ultraloveninja


2 Answers

Wordpress files are kept inside the container, for example you can find wp-content at:

/var/www/html/wp-content

But, to get "inside" your running container you will have to do something like docker container exec -it <your_container_name> bash. More here: How to get into a docker container?


Containers are considered ephemeral, which means that a good practice is to work in a way that lets you easily stop/remove a container and spin up a new one without losing your stuff. To persist your data you have the option to use volumes.


You might also want to take a look at this, which worked for me: Volume mount when setting up Wordpress with docker. If your case is to develop wordpress on docker containers, then... it's a different case.

like image 121
tgogos Avatar answered Oct 18 '22 09:10

tgogos


If you have not set a binding when running the docker image for the first time you can still do the following.

docker volume ls 

will list all of your volumes used by your local docker. What you can do is the following :

docker volume inspect "VOLUME NAME"


e.g. docker volume inspect "181f5c9916a29e9f654317988f49237ea9067157bc94041176ab6ae5f9a57954"

you will find the Mountpoint of each docker volume. There could more than 1, every one of those will have a mount point.

like image 41
Jan Koch Avatar answered Oct 18 '22 08:10

Jan Koch