Skip to content

Commit

Permalink
Do not copy data dir on build. Create data dir if needed on launch
Browse files Browse the repository at this point in the history
  • Loading branch information
gabek committed Apr 12, 2021
1 parent 202a6aa commit 1b27d0b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build/release/Dockerfile-build
Expand Up @@ -24,5 +24,5 @@ WORKDIR /app
COPY --from=build /build/owncast /app/owncast
COPY --from=build /build/webroot /app/webroot
COPY --from=build /build/static /app/static
COPY --from=build /build/data /app/data
RUN mkdir /app/data
CMD ["/app/owncast"]
6 changes: 6 additions & 0 deletions main.go
Expand Up @@ -2,6 +2,7 @@ package main

import (
"flag"
"os"
"strconv"
"time"

Expand Down Expand Up @@ -56,6 +57,11 @@ func main() {
}
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
if *restoreDatabaseFile != "" {
databaseFile := config.DatabaseFilePath
Expand Down

0 comments on commit 1b27d0b

Please sign in to comment.