Closed ghost closed 3 years ago
Hi @mazecat !
In you adminer login, try to use the hostname "mysql" instead of "db". Also, adminer need to use a mysql user password.
So, stop all your containers.
Edit your docker-compose.yaml and .env files.
Start docker containers with composer up
or docker-compose up -d --build
.
This is for example my docker-compose.yaml file:
version: '3'
services:
nginx:
image: nginx:latest
container_name: slim4-api-skeleton-nginx-container
ports:
- "8081:80"
volumes:
- ./:/var/www/html
- ./docker/nginx/conf.d:/etc/nginx/conf.d
php-fpm:
build: ./docker/php7
container_name: slim4-api-skeleton-php-container
links:
- mysql
environment:
- PHP_FPM_ENABLE=1
- PHP_FPM_SERVER_ADDR=php
- PHP_FPM_SERVER_PORT=9000
- PHP_FPM_TIMEOUT=${HTTPD_TIMEOUT_TO_PHP_FPM:-180}
volumes:
- ./:/var/www/html
mysql:
image: mysql:5.7
ports:
- 33060:3306
environment:
MYSQL_DATABASE: slim4_api_skeleton
MYSQL_ROOT_PASSWORD: example
adminer:
image: adminer
restart: always
ports:
- 8080:8080
volumes:
my-data:
and this is my .env file:
DB_HOST='mysql'
DB_NAME='slim4_api_skeleton'
DB_USER='root'
DB_PASS='example'
DB_PORT='3306'
DISPLAY_ERROR_DETAILS=true
SLIM_BASE_PATH=''
I hope it'll work for you. GoodBye.-
@maurobonfietti Thanks. it's work for me.
I'm a beginner in docker beginner and try to using docker compose start up the project and check the db
but when I add a view for check db in the docker-compose file,
but it will display error message when I login
What problem in the docker compose file?
Ps.
Thanks.
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name does not resolve