Code Monkey home page Code Monkey logo

docker-leanote's Introduction

注意:本仓库已删除大文件并强制提交。

Attention: this repo has removed big file and force commited.


Docker运行蚂蚁笔记

Screen shot

镜像提供内置数据库和无数据库版,内置数据库基于mongo:3.2构建,蚂蚁笔记所需数据都已初始化完毕,非内置数据库启动后需修改数据配置再重启。

内置数据库,容器内多进程非Docker推荐做法,只为方便。

版本选择

full: 完整功能,内置数据库 nodb: 完整功能,不包含数据库 lite: 仅有leanote程序,网页版不支持导出pdf和备份数据库,供客户端用户使用

具体如下

数据库配置(nodb版使用)

初始化数据库看这里

导入数据库后,以下配置根据实际环境修改

# mongdb
db.host=192.168.1.20
db.port=27017
db.dbname=leanote # required
db.username= # if not exists, please leave it blank
db.password= # if not exists, please leave it blank
# or you can set the mongodb url for more complex needs the format is:
# mongodb://myuser:mypass@localhost:40001,otherhost:40001/mydb
# db.url=mongodb://root:root123@localhost:27017/leanote
# db.urlEnv=${MONGODB_URL} # set url from env. eg. mongodb://root:root123@localhost:27017/leanote

数据目录简介

为方便修改配置和迁移数据,建议映射如下文件夹。

/data/db                # 内置mongodb的数据目录,nodb版无此目录
/data/leanote/conf      # 笔记的配置文件目录
/data/leanote/files     # 笔记内上传的图片、文件存放目录
/data/leanote/public/upload     # 头像上传路径

运行

docker run -d --name leanote \
    -v `pwd`/db:/data/db \
    -v `pwd`/conf/:/data/leanote/conf \
    -v `pwd`/files:/data/leanote/files \
    -v `pwd`/upload:/data/leanote/public/upload \
    -p 9000:9000 \
    axboy/leanote

备份数据

  • 方案一

通过备份文件来备份数据,数据库版本大更时不兼容,比如mongo:3.2到mongo:3.4

  • 方案二

使用admin账号到管理后台备份,lite版不支持

  • 方案三

自行通过mongodump备份

个人更倾向于方案一,因为数据库不包含上传的文件,不是仅仅备份数据库就行

修改时区

默认为北京时间,如需修改,参考如下命令。

ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
echo "Asia/Shanghai" > /etc/timezone
  • 2.6版启动后不能访问

2.6版默认绑定localhost, 不能通过ip访问Leanote, 请修改 app.conf

http.addr=0.0.0.0 # listen on all ip addresses

重启Leanote

其它

初始用户

user1 username: admin, password: abc123 (管理员, 只有该用户才有权管理后台, 请及时修改密码)
user2 username: [email protected], password: [email protected] (仅供体验使用)

补充

docker-leanote's People

Contributors

axboy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.