Wordpress - I lost my user's data

Hello, I’m a noob in Docker.

I have installed Wordpress with Docker (SO: Win 7)

I can’t login using docker-compose and the yml file. I had this problem: “MySQL Connection Error”.

So, i run the following commands:

$ docker run -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=wordpress --name wordpressdb -v "$PWD/database":/var/lib/mysql -d mariadb:latest
$ docker pull wordpress
$ docker run -e WORDPRESS_DB_PASSWORD=password --name wordpress --link wordpressdb:mysql -p 8083:80 -v "$PWD/html":/var/www/html -d wordpress

I could enter to the initial WordPress setup page at http://192.168.99.100:8083/wp-admin/install.php;
and it work it!

I could work with my site, but then i rebooted the PC and now, i can’t access to my site.

The container’s status were “Exited”. So, i restarted the containers, but wordpress appared as if i have never used it.

I can enter, but i have to create a new site.

You should work with the compose file from your other question. There you create volumes with persistant data. If the setup still doesn’t work, we better look at the problems you have there.

1 Like

As @tekki suggest, use Wordpress throght docker-compose.
Here is an Example from Docker Site