generated from nathanwoodburn/go-webserver-template
feat: Update dockerfile
All checks were successful
Build Docker / BuildSite (push) Successful in 1m21s
All checks were successful
Build Docker / BuildSite (push) Successful in 1m21s
This commit is contained in:
parent
097f04bb76
commit
b909a5371f
@ -4,6 +4,9 @@ FROM golang:1.21
|
|||||||
# Set destination for COPY
|
# Set destination for COPY
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Install knot-dnsutils
|
||||||
|
RUN apt-get update && apt-get install -y knot-dnsutils
|
||||||
|
|
||||||
COPY main.go ./
|
COPY main.go ./
|
||||||
COPY go.mod ./
|
COPY go.mod ./
|
||||||
COPY go.sum ./
|
COPY go.sum ./
|
||||||
|
12
main.go
12
main.go
@ -23,10 +23,7 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
// Try to load the .env.example file
|
// Try to load the .env.example file
|
||||||
fmt.Println("Error loading .env file, trying .env.example")
|
fmt.Println("Error loading .env file, trying .env.example")
|
||||||
err = godotenv.Load(".env.example")
|
godotenv.Load(".env.example")
|
||||||
if err != nil {
|
|
||||||
log.Fatal("Error loading .env.example file")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start ticker
|
// Start ticker
|
||||||
@ -186,11 +183,8 @@ func startTicker() {
|
|||||||
ticker := time.NewTicker(10 * time.Second)
|
ticker := time.NewTicker(10 * time.Second)
|
||||||
defer ticker.Stop()
|
defer ticker.Stop()
|
||||||
|
|
||||||
for {
|
for range ticker.C {
|
||||||
select {
|
runBashScript()
|
||||||
case <-ticker.C:
|
|
||||||
runBashScript()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user