From 5e84a57759335bc61a8eaddf969608b5f3637623 Mon Sep 17 00:00:00 2001 From: steven Date: Sun, 12 Dec 2021 12:52:58 +0800 Subject: [PATCH] update data mounting point --- Dockerfile | 3 --- store/db.go | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 73d60c25..b9857a5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,9 +28,6 @@ COPY --from=backend /backend-build/memos /usr/local/memos/ COPY --from=backend /backend-build/resources /usr/local/memos/resources COPY --from=frontend /frontend-build/dist /usr/local/memos/web/dist -# Directory to store the data, which can be referenced as the mounting point. -RUN mkdir -p /var/opt/memos/data - CMD ["./memos"] EXPOSE 8080 diff --git a/store/db.go b/store/db.go index 4a00ae7b..c71c8ba1 100644 --- a/store/db.go +++ b/store/db.go @@ -16,7 +16,8 @@ import ( var DB *sql.DB func InitDBConn() { - dbFilePath := "/var/opt/memos/data/memos.db" + // mounting point in docker is "/usr/local/memos/data" + dbFilePath := "./data/memos.db" if _, err := os.Stat(dbFilePath); err != nil { dbFilePath = "./resources/memos.db"