From b909a5371fd12d389f94353079a068a5e712cd4e Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Sat, 22 Jun 2024 19:06:14 +1000 Subject: [PATCH] feat: Update dockerfile --- Dockerfile | 3 +++ main.go | 12 +++--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6da842c..469e2d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,9 @@ FROM golang:1.21 # Set destination for COPY WORKDIR /app +# Install knot-dnsutils +RUN apt-get update && apt-get install -y knot-dnsutils + COPY main.go ./ COPY go.mod ./ COPY go.sum ./ diff --git a/main.go b/main.go index 7efd318..9d0c02e 100644 --- a/main.go +++ b/main.go @@ -23,10 +23,7 @@ func main() { if err != nil { // Try to load the .env.example file fmt.Println("Error loading .env file, trying .env.example") - err = godotenv.Load(".env.example") - if err != nil { - log.Fatal("Error loading .env.example file") - } + godotenv.Load(".env.example") } // Start ticker @@ -186,11 +183,8 @@ func startTicker() { ticker := time.NewTicker(10 * time.Second) defer ticker.Stop() - for { - select { - case <-ticker.C: - runBashScript() - } + for range ticker.C { + runBashScript() } }