I’m trying to create a basic development machine ruing php7, nginx and mariaDB
I’m using docker-compose in order to do this.
The stripped down version of my compose file is as follows:
wwwroot:
container_name: wwwroot
image: wwwroot
volumes:
- .:/var/www
restart: always
nginx:
container_name: nginx
image: nginx
links:
- php70
volumes_from:
- wwwroot
ports:
- "80:80"
- "443:443"
restart: always
php70:
container_name: php70
image: kreable/php70
volumes_from:
- wwwroot
links:
- mariadb
restart: always
mariadb:
container_name: mariadb
image: mariadb
environment:
DB_ADMIN_PASS: pass
ports:
- "3306:3306"
restart: always
This works fine and creates the desired containers. The problem comes with trying to coect a basic php script to the database. I always get:
SQLSTATE[HY000] [2002] Coection refused
My php application is on the wwwroot container
Do have I to do any further configuration to allow my php application to coect to the mariaDB container?
Thanks
