0
I’m having trouble accessing the application via Docker. I’m getting a "Unable to connect" firefox error when trying to access the localhost:8899 address (ja tentei127.0.0.1:8899 and it also doesn’t work)
I’ve checked the containers via Docker-Compose ps, and they’re all ok. It seems like an error related to mysql, but I’m not sure what it would be exactly.
Details:
- Operating System: Ubuntu 18.04
- PHP version: 5.6
- Framework: Zend Framework 1
Configuration files:
File . env
DOCKER_HOST_IP=192.168.1.3
Docker-Compose.yml file
version: "3.1"
services:
mysql:
image: mysql:5.7
container_name: stf-mysql
working_dir: /application
volumes:
- .:/application
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=falcom_chamados
ports:
- "8901:3306"
webserver:
image: nginx:alpine
container_name: stf-webserver
working_dir: /application
volumes:
- .:/application
- ./phpdocker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
ports:
- "8080:80"
php-fpm:
build: phpdocker/php-fpm
container_name: stf-php-fpm
working_dir: /application
environment:
XDEBUG_CONFIG: "remote_host=${DOCKER_HOST_IP}"
PHP_IDE_CONFIG: "serverName=falcom-chamados"
ports:
- "9019:9000"
volumes:
- .:/application
- ./phpdocker/php-fpm/php-ini-overrides.ini:/etc/php5/fpm/conf.d /99-overrides.ini
The project also has a file called db.php, where you can find some database-related settings
db.php
<?php
$config = array();
if (APPLICATION_ENV != 'development') {
$config['dsn'] = "mysql://root:[email protected]:8901/falcom_chamados";
} else {
$config['dsn'] = "mysql://root:[email protected]:8901/falcom_chamados";
}
return $config;