1. Create a new project directory
root@iZ2ze0ht45qn4m8m1wjfdrZ:~# mkdir my_wordpress
root@iZ2ze0ht45qn4m8m1wjfdrZ:~# ls
grid_demo.py my_wordpress result.csv result_gip.csv result_gzip.csv shj_test
2. Go to the my_wordpress directory
root@iZ2ze0ht45qn4m8m1wjfdrZ:~# cd my_wordpress/
root@iZ2ze0ht45qn4m8m1wjfdrZ:~/my_wordpress#
3. Create a new yml file vi docker-compose.yaml
with the following content:
version: '3.3'
services:
db:
image: mysql:5.7
volumes:
- dbdata:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "8000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
volumes:
dbdata:
4. Rundocker-compose up -d
admin@iZ2ze0ht45qn4m8m1wjfdrZ:~/Python-3.6.0/my_wordpress$ sudo docker-compose up -d
sudo: unable to resolve host iZ2ze0ht45qn4m8m1wjfdrZ
Creating network "my_wordpress_default" with the default driver
Creating volume "my_wordpress_dbdata" with default driver
Pulling db (mysql:5.7)...
5.7: Pulling from library/mysql
Digest: sha256:691c55aabb3c4e3b89b953dd2f022f7ea845e5443954767d321d5f5fa394e28c
Status: Downloaded newer image for mysql:5.7
Creating my_wordpress_db_1 ... done
Creating my_wordpress_wordpress_1 ... done
admin@iZ2ze0ht45qn4m8m1wjfdrZ:~/Python-3.6.0/my_wordpress$
4. Open wordpress in the browser and use the port 8000 configured in the yml file: localhost:8000
5. Set the username and other information, install wordpress
6. Login to wordpress with username and password