I am trying to access phpMyAdmin behind nginx-proxy Docker image, hosted on my VPS.
When I try login in phpMyAdmin, I get the error: php_network_getaddresses: getaddrinfo failed: Name or service not known
The docker-compose file is:
version: "3"
services:
mysql:
build:
context: "./bin/mysql8"
container_name: 'mysql'
restart: 'always'
ports:
- "3306:3306"
volumes:
- ./data/mysql:/var/lib/mysql
- ./logs/mysql:/var/log/mysql
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: 'sc-phpmyadmin'
links:
- mysql
environment:
PMA_HOST: mysql
PMA_PORT: 3306
PMA_USER: ${MYSQL_USER}
PMA_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
expose:
- 80
environment:
VIRTUAL_HOST: myadmin.example.com
LETSENCRYPT_HOST: myadmin.example.com
volumes:
- /sessions
networks:
default:
external:
name: nginx-proxy
The connection is protected with letsencrypt-nginx-proxy-companion (working correctly). I have already read this thread about the error https://github.com/jwilder/nginx-proxy/issues/596 , but there is no working solution.