TechnitiumSoftware / DnsServer

Technitium DNS Server
https://technitium.com/dns/
GNU General Public License v3.0
4.27k stars 418 forks source link

use docker compose with V11.0.3 lost settings #585

Closed Gsonovb closed 1 year ago

Gsonovb commented 1 year ago

hi I loss configuration while trying to upgrade locally (v11>v11.0.3),

By viewing the source code, I found that one command in the dockerfile

The following is my solution: add "command" to the docker compose file

version: "3.4"
services:
  dns-server:
    container_name: dns-server
    hostname: dns-server
    image: technitium/dns-server:11.0.3
    deploy:
      resources:
        limits:
          cpus: '2'
          memory: 512mb
    environment:
      TZ: 'Asia/Shanghai'
    command: "/etc/dns/config"    <-- here
    ports:
      - "5380:5380/tcp" #DNS web console
      - "53:53/udp" #DNS service
      - "53:53/tcp" #DNS service
      - "67:67/udp" #DHCP service
      - "853:853/tcp" #DNS-over-TLS service
      - "443:443/tcp" #DNS-over-HTTPS service
      - "80:80/tcp" #DNS-over-HTTPS service certbot certificate renewal
      - "8053:8053/tcp" #DNS-over-HTTPS using reverse proxy

    volumes:
      - config:/etc/dns/config

    restart: unless-stopped
    #Use "host" network mode for DHCP deployments
    network_mode: "host"
    #使用 HOST模式必须禁用以下内容 同时需要禁用 系统自带的53端口占用
    # https://www.linuxuprising.com/2020/07/ubuntu-how-to-free-up-port-53-used-by.html

volumes:
  config:
ShreyasZare commented 1 year ago

Thanks for the post. Your solution is incorrect. The issue is due to change of path for the volume in the docker image. Just update the path for the volume from /etc/dns/config to /etc/dns and it will work.

Gsonovb commented 1 year ago

yes, At first, I didn't notice the Docker Compose update. I view documents , but the configuration file path prompt is not obvious.

I later found more detailed instructions when searching for blogs

It is recommended to add environment variables and command line descriptions to README.