mirror of
https://github.com/usememos/memos.git
synced 2024-12-26 07:01:17 +08:00
update data mounting point
This commit is contained in:
parent
d2084f869b
commit
5e84a57759
2 changed files with 2 additions and 4 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue