I am trying to setup my environment to build a wordpress site but docker-compose fails with connection refuded.
I sent more than 2 days trying to figure out, browsing the web but in vain. I tried solutions available on stack overflow, still in vain.
This is my my docker-compose
version: '3.7'
services:
wordpress:
depends_on:
- db
image: wordpress
container_name: wp-web
ports:
- 7000:80
restart: unless-stopped
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: banana
WORDPRESS_DB_PASSWORD: banana
WORDPRESS_DB_NAME: banana
working_dir: /var/www/html
volumes:
- ./wp-content:/var/www/html/wp-content
- ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
db:
image: mysql:5.7
container_name: db_server
command: --default-authentication-plugin=mysql_native_password
volumes:
- ./db_data:/home/abelmbula/Documents/dockerapp/lib/mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: banana
MYSQL_DATABASE: banana
MYSQL_USER: banana
MYSQL_PASSWORD: banana
ports:
- 8889:3306
volumes:
db_data:
I get this out put
Starting db_server ... done
Recreating wp-web ... done
Attaching to db_server, wp-web
db_server | Initializing database
db_server | 2019-06-14T13:32:53.477264Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
db_server | 2019-06-14T13:32:53.479113Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
db_server | 2019-06-14T13:32:53.479146Z 0 [ERROR] Aborting
db_server |
wp-web | [14-Jun-2019 13:33:03 UTC] PHP Warning: mysqli::__construct(): (HY000/2002): Connection refused in Standard input code on line 22
wp-web |
wp-web | MySQL Connection Error: (2002) Connection refused
db_server exited with code 1
Is there something wrong with my file above?