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"