update data mounting point

This commit is contained in:
steven 2021-12-12 12:52:58 +08:00
parent d2084f869b
commit 5e84a57759
2 changed files with 2 additions and 4 deletions

View file

@ -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

View file

@ -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"