feat: Update dockerfile
All checks were successful
Build Docker / BuildSite (push) Successful in 1m21s

This commit is contained in:
Nathan Woodburn 2024-06-22 19:06:14 +10:00
parent 097f04bb76
commit b909a5371f
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
2 changed files with 6 additions and 9 deletions

View File

@ -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 ./

10
main.go
View File

@ -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,13 +183,10 @@ func startTicker() {
ticker := time.NewTicker(10 * time.Second)
defer ticker.Stop()
for {
select {
case <-ticker.C:
for range ticker.C {
runBashScript()
}
}
}
func runBashScript() {
// Log the time