I am new to docker, trying to install wordpress details are
OS : Windows 10 Home
Docker Version : Docker version 19.03.1, build 74b1e89e8a
docker-compose version 1.24.1, build 4667896b
my file docker-compose.yml is
version: '3.3'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: mysql
MYSQL_USER: admin
MYSQL_PASSWORD: admin
wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "8000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: admin
WORDPRESS_DB_PASSWORD: admin
WORDPRESS_DB_NAME: admin
volume:
db_data: {}
it is working fine with
docker-compose up -d
docker ps
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
944e0ea8ff69 wordpress:latest "docker-entrypoint.s…" 56 minutes ago Up 56 minutes 0.0.0.0:8000->80/tcp wordpress_wordpress_1
5a3890fed7fe redis "docker-entrypoint.s…" About an hour ago Up About an hour 6379/tcp sleepy_matsumoto
4edf3f9fc944 mysql:5.7 "docker-entrypoint.s…" 2 hours ago Up 59 minutes 3306/tcp, 33060/tcp wordpress_db_1
But when I am running http://localhost:8000 or http://localhost:80 in browser it is showing site is not reachable. Can you help me to resolve this issue urgently ?
$ sudo podman-compose up
...
MySQL Connection Error: (2002) Connection refused
...
MySQL "CREATE DATABASE" Error: Access denied for user 'admin'@'%' to database 'admin'
WARNING: unable to establish a database connection to 'db:3306'
continuing anyways (which might have unexpected results)
Yes, I’m working on fedora actually…
So, something seems to be wrong with the compose file settings. Is it copy&paste from docker-hub?