Do not copy data dir on build. Create data dir if needed on launch
This commit is contained in:
parent
202a6aa2e5
commit
1b27d0b46d
@ -24,5 +24,5 @@ WORKDIR /app
|
|||||||
COPY --from=build /build/owncast /app/owncast
|
COPY --from=build /build/owncast /app/owncast
|
||||||
COPY --from=build /build/webroot /app/webroot
|
COPY --from=build /build/webroot /app/webroot
|
||||||
COPY --from=build /build/static /app/static
|
COPY --from=build /build/static /app/static
|
||||||
COPY --from=build /build/data /app/data
|
RUN mkdir /app/data
|
||||||
CMD ["/app/owncast"]
|
CMD ["/app/owncast"]
|
||||||
|
6
main.go
6
main.go
@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -56,6 +57,11 @@ func main() {
|
|||||||
}
|
}
|
||||||
log.Infoln(config.GetReleaseString())
|
log.Infoln(config.GetReleaseString())
|
||||||
|
|
||||||
|
// Create the data directory if needed
|
||||||
|
if !utils.DoesFileExists("data") {
|
||||||
|
os.Mkdir("./data", 0700)
|
||||||
|
}
|
||||||
|
|
||||||
// Allows a user to restore a specific database backup
|
// Allows a user to restore a specific database backup
|
||||||
if *restoreDatabaseFile != "" {
|
if *restoreDatabaseFile != "" {
|
||||||
databaseFile := config.DatabaseFilePath
|
databaseFile := config.DatabaseFilePath
|
||||||
|
Loading…
Reference in New Issue
Block a user