diff --git a/Dockerfile b/Dockerfile index 90f69da..e6d26e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,6 +28,7 @@ RUN ["chmod", "-R", "u=rwX,go=rX", "/entrypoint-db-init"] RUN ["chmod", "o+x", "/var/log/apache2"] RUN ["chown", "www-data:www-data", "/var/run/apache2"] RUN ["ln", "-vs", "/data/etc/icingaweb2", "/etc/icingaweb2"] +RUN ["ln", "-vs", "/data/var/lib/icingaweb2", "/var/lib/icingaweb2"] RUN ["install", "-o", "www-data", "-g", "www-data", "-d", "/data"] ENTRYPOINT ["/entrypoint"] diff --git a/entrypoint/main.go b/entrypoint/main.go index 165040a..52723df 100644 --- a/entrypoint/main.go +++ b/entrypoint/main.go @@ -40,9 +40,11 @@ func entrypoint() error { if os.Getpid() == 1 { logf("info", "Initializing /data as we're the init process") - logf("debug", "Creating %#v", enModsDir) - if errMA := os.MkdirAll(enModsDir, dirMode); errMA != nil { - return errMA + for _, dir := range []string{enModsDir, "/data/var/lib/icingaweb2"} { + logf("debug", "Creating %#v", dir) + if errMA := os.MkdirAll(dir, dirMode); errMA != nil { + return errMA + } } logf("debug", "Translating env vars to .ini config")