add inotify to container
load old last post from config
This commit is contained in:
@@ -21,10 +21,9 @@ RUN go build -o /go/bin/fbBot .
|
||||
FROM alpine
|
||||
VOLUME /opt/tmp
|
||||
RUN apk update && \
|
||||
apk add --no-cache ca-certificates chromium chromium-chromedriver
|
||||
apk add --no-cache ca-certificates chromium chromium-chromedriver inotify-tools inotify-tools-dev
|
||||
# Copy our static executable.
|
||||
COPY --from=builder /go/bin/fbBot /opt/fbBot
|
||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||
COPY contrib/ /
|
||||
COPY config.yaml /etc/fbBot/config.yaml
|
||||
# Run the hello binary.
|
||||
|
||||
11
main.go
11
main.go
@@ -20,11 +20,12 @@ import (
|
||||
func init() {
|
||||
viper.SetDefault("development_mode", true)
|
||||
viper.SetDefault("cronjob_interval", "@every 5m")
|
||||
viper.SetDefault("lastPostTimestamp", "2000-01-01T00:00:00Z")
|
||||
viper.SetConfigType("yaml")
|
||||
viper.SetConfigName("config") // name of config file (without extension)
|
||||
viper.AddConfigPath("/etc/fbBot/") // path to look for the config file in
|
||||
viper.AddConfigPath("$HOME/.fbBot") // call multiple times to add many search paths
|
||||
viper.AddConfigPath(".") // optionally look for config in the working directory
|
||||
viper.SetConfigName("config") // name of config file (without extension)
|
||||
viper.AddConfigPath("/etc/fbBot/") // path to look for the config file in
|
||||
//viper.AddConfigPath("$HOME/.fbBot") // call multiple times to add many search paths
|
||||
//viper.AddConfigPath(".") // optionally look for config in the working directory
|
||||
if err := viper.ReadInConfig(); err != nil {
|
||||
if _, ok := err.(viper.ConfigFileNotFoundError); ok {
|
||||
// any approach to require this configuration into your program.
|
||||
@@ -72,7 +73,7 @@ login:
|
||||
return innerHTML
|
||||
},
|
||||
})
|
||||
|
||||
lastUpdatePosted = viper.GetString("lastPostTimestamp")
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
Reference in New Issue
Block a user