参考链接:parse-server parse-dashboard
docker run --name mongo -v /data/mongo:/data -p 27017:27017 -d mongo
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")
docker run --name parse_server -p 1337:1337 --link mongo:mongo -d parsre-server:v1.0 --appId myapp --masterKey appKey --databaseURI mongodb://mongo/app
创建时要给parse指定一个appId和masterKey mongodb://mongo/app #app为创建的数据库的名字
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
--allowInsecureHTTP #parse_dashboard默认只能用https访问,此参数可以开启http访问
config.json内容
{
"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界面