以下是我尝试访问在Docker上运行的解析仪表板(本地)
这是我运行的docker命令:
docker run -d -p 4040:4040 --name myappname-local-dashboard -e PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1 -e USER1=admin -e USER1_PASSWORD=pass -v /home/xybrek/parse-dashboard/config.json:/home/xybrek/parse-dashboard/Parse-Dashboard/parse-dashboard-config.json parse-dashboard
config.json
{
"appId": "appId",
"cloud": "main.js",
"masterKey": "masterKey",
"javascriptKey" : "javascriptKey",
"restAPIKey" : "restAPIKey",
"databaseURI": "mongodb://localhost/test",
"port": 8080
}
解析-仪表板config.json
{
"apps": [{
"serverURL": "http://localhost:1337/parse",
"appId": "appId",
"masterKey": "masterKey",
"appName": "myappname",
"iconName": ""
}],
"iconsFolder": "icons",
"users":
[
{
"user":"admin",
"pass":"pass"
}
]
}
这里可能有什么问题?
答案 0 :(得分:0)
您将配置放在错误的位置。
使用此:
docker run -d -p 4040:4040 --name myappname-local-dashboard \
-e PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1 \
-e USER1=admin \
-e USER1_PASSWORD=pass \
-v $(pwd)/parse-dashboard-config.json:/src/Parse-Dashboard/parse-dashboard-config.json \
parse-dashboard
此外,我更改了音量源($(pwd)/parse-dashboard-config.json
)以从当前目录获取配置。
请参阅docs。
编辑。也许您需要将apps
添加到用户配置:
{
"apps": [{
"serverURL": "http://localhost:1337/parse",
"appId": "appId",
"masterKey": "masterKey",
"appName": "myappname",
"iconName": ""
}],
"iconsFolder": "icons",
"users":
[
{
"user":"admin",
"pass":"pass",
"apps": [{"appId": "appId"}]
}
]
}