docker-compose.yml
version: '3'
services:
dnsx:
image: dingdayu/dnsx
restart: always
hostname: dnsx
depends_on:
- mysql
environment:
DNSX_MYSQL_DNS: "root:${DB_PASSWORD}@tcp(mysql:3306)/dnsx?charset=utf8&parseTime=True&loc=Local"
ports:
- "8080:8080"
- "53:53"
- "53:53/udp"
volumes:
- ./config:/opt/dnsx/config
mysql:
image: mysql:5.7
container_name: "mysql"
expose:
- 3306
volumes:
- ./data:/var/lib/mysql
env_file:
- .env
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
MYSQL_DATABASE: dnsx
restart: always