Hi, Junius
Follow detail information that I follow official docker install guide, you can check that:
[root@frank-vps my_wordpress]# more docker-compose.yml
version: '3'
services:
db:
image: mysql:5.7
volumes:
- db_data:/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:
db_data:
[root@frank-vps my_wordpress]#
[root@frank-vps my_wordpress]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
91f3d090a116 wordpress:latest "docker-entrypoint..." 26 hours ago Up 26 hours 0.0.0.0:8000->80/tcp mywordpress_wordpress_1
b116d0cf4c67 mysql:5.7 "docker-entrypoint..." 26 hours ago Up 26 hours 3306/tcp mywordpress_db_1
[root@frank-vps my_wordpress]# curl localhost:8000
[root@frank-vps my_wordpress]#
[root@frank-vps my_wordpress]#