Hey Folks
I run docker on Synology NAS. New to docker-compose and trying to create that file as I believe that is better than "docker run" ?
Here is what I have copied and modifed for the yml file.
version: "3"
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
network_mode: "host"
environment:
TZ: 'XXXX\XXXXX'
WEBPASSWORD: 'password'
DNSMASQ_LISTENING: 'all'
WEB_PORT: '7113'
ServerIP: '192.168.X.X'
volumes:
- '/volume1/docker/pihole/hosts/hosts:/etc/hosts'
- '/volume1/docker/pihole/dnsmasq.d:/etc/dnsmasq.d'
- '/volume1/docker/pihole:/etc/pihole'
dns:
- 127.0.0.1
- 1.1.1.1
cap_add:
- NET_ADMIN
restart: unless-stopped
labels:
- "com.centurylinklabs.watchtower.enable=false"
Had a few basic questions
-
Does the file look good? anything wrong or missing? (have replaced some sensitive data with XXX)
-
How do I make sure whenever it starts, it has CloudFlare IP's for DNS?
-
When I have the file docker-compose.yml in a folder and I do "docker-compose up" the result stays there until I do CTRL+C and it breaks and stops the container. How do I use the file to just raise the container and then quit to command line gracefully?
Creating pihole...
Creating pihole... done
Attaching to pihole
pihole | WARNING: no logs are available with the 'db' log driver^CGracefully stopping... (press Ctrl+C again to force)
Stopping pihole ... done
-
If I ever want to update using the yml file, how do I do so? Currently I use Synology NAS GUI - stop it, click on clear, and then do a "docker pull pihole/pihole" and then start again via GUI. Is there a 1 command way to update via compose file?
-
Even thought I have "restart: unless-stopped" the Synology GUI for docker doesn't show the "enable auto-restart" ticked? What is wrong there?
Just trying to figure out what is the best way to deploy and maintain docker