mirror of
https://github.com/usememos/memos.git
synced 2025-12-16 21:59:25 +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=backend /backend-build/resources /usr/local/memos/resources
|
||||||
COPY --from=frontend /frontend-build/dist /usr/local/memos/web/dist
|
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"]
|
CMD ["./memos"]
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,8 @@ import (
|
||||||
var DB *sql.DB
|
var DB *sql.DB
|
||||||
|
|
||||||
func InitDBConn() {
|
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 {
|
if _, err := os.Stat(dbFilePath); err != nil {
|
||||||
dbFilePath = "./resources/memos.db"
|
dbFilePath = "./resources/memos.db"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue