add inotify to container

load old last post from config
This commit is contained in:
2020-01-16 12:31:29 +01:00
parent 79abcb72fb
commit 4aa8b0bcec
2 changed files with 7 additions and 7 deletions

View File

@@ -21,10 +21,9 @@ RUN go build -o /go/bin/fbBot .
FROM alpine FROM alpine
VOLUME /opt/tmp VOLUME /opt/tmp
RUN apk update && \ 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 our static executable.
COPY --from=builder /go/bin/fbBot /opt/fbBot 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 contrib/ /
COPY config.yaml /etc/fbBot/config.yaml COPY config.yaml /etc/fbBot/config.yaml
# Run the hello binary. # Run the hello binary.

View File

@@ -20,11 +20,12 @@ import (
func init() { func init() {
viper.SetDefault("development_mode", true) viper.SetDefault("development_mode", true)
viper.SetDefault("cronjob_interval", "@every 5m") viper.SetDefault("cronjob_interval", "@every 5m")
viper.SetDefault("lastPostTimestamp", "2000-01-01T00:00:00Z")
viper.SetConfigType("yaml") viper.SetConfigType("yaml")
viper.SetConfigName("config") // name of config file (without extension) viper.SetConfigName("config") // name of config file (without extension)
viper.AddConfigPath("/etc/fbBot/") // path to look for the config file in 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("$HOME/.fbBot") // call multiple times to add many search paths
viper.AddConfigPath(".") // optionally look for config in the working directory //viper.AddConfigPath(".") // optionally look for config in the working directory
if err := viper.ReadInConfig(); err != nil { if err := viper.ReadInConfig(); err != nil {
if _, ok := err.(viper.ConfigFileNotFoundError); ok { if _, ok := err.(viper.ConfigFileNotFoundError); ok {
// any approach to require this configuration into your program. // any approach to require this configuration into your program.
@@ -72,7 +73,7 @@ login:
return innerHTML return innerHTML
}, },
}) })
lastUpdatePosted = viper.GetString("lastPostTimestamp")
} }
func main() { func main() {