1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| docker pull mysql:latest
docker run -d --name mysql --restart=always -v /data/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=password -p 3306:3306 mysql:latest
docker exec -it mysql /bin/bash
mysql -u root -p
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
create database wordpress;
exit exit
docker inspect --format='{{.NetworkSettings.IPAddress}}' mysql 172.17.0.2
docker pull wordpress:latest
docker run -d --name wordpress --restart=always -p 81:80 --link mysql:mysql wordpress
docker cp wordpress:/usr/local/etc/php/php.ini-production /data/php.ini
vi /data/php.ini
upload_max_filesize = 200M post_max_size = 8M memory_limit = 500M
docker stop wordpress
docker rm wordpress
docker run -d --name wordpress --restart=always -v /data/php.ini:/usr/local/etc/php/php.ini -p 81:80 --link mysql:mysql wordpress
|