خرید بک لینک

Vote count: 0

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

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 7 ارديبهشت 1395 ساعت: 23:27

صفحه بندی