Commit 5e84a577 authored by steven's avatar steven

update data mounting point

parent d2084f86
......@@ -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
......@@ -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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment