docker-app-parse-dashboard部署
参考链接:parse-server parse-dashboard
创建mongo
1
| docker run --name mongo -v /data/mongo:/data -p 27017:27017 -d mongo
|
创建mongo数据库的账号和密码
1 2 3 4 5 6
| use admin db.createUser({ user: 'admin', pwd: 'adminapp', roles: [ { role: "root", db: "admin" } ] }); db.auth("admin","adminapp") use apps db.createUser({user:"root",pwd:"admin",roles:[{role:"readWrite",db:"apps"}]}); db.auth("root","admin")
|
创建parse-server
1
| docker run --name parse_server -p 1337:1337 --link mongo:mongo -d parsre-server:v1.0 --appId myapp --masterKey appKey --databaseURI mongodb://mongo/app
|
1 2 3
| 创建时要给parse指定一个appId和masterKey
mongodb://mongo/app #app为创建的数据库的名字
|
创建parse-dashboard
1
| docker run --name parse_dashboard -d -p 8080:4040 -v /data/website/Parse-Dashboard/parse-dashboard-config.json:/src/Parse-Dashboard/parse-dashboard-config.json parse-dashboard:8-alpine --allowInsecureHTTP
|
1
| --allowInsecureHTTP #parse_dashboard默认只能用https访问,此参数可以开启http访问
|
config.json内容
1 2 3 4 5 6 7 8 9 10 11 12 13
| { "apps": [{ "serverURL": "https://ip:1337/parse", #parse-server服务的域名 "appId": "myapp", "masterKey":"appKey, #parse-server的ID及Key "appName": "apps" #app的名字 }], "users":[{ "user":"test", "pass":"testapp" #开启账号密码登录的参数(可以开启多个账号) }] }
|
浏览器打开
http://ip:8080 打开dashboard界面