Skip to content

快速参考

  • 由……维护
    mongo-express

  • 何处获取帮助:
    Docker 社区 Slack、服务器故障、Unix & Linux 或 Stack Overflow

支持的标签及相应的 Dockerfile 链接

快速参考(续)

什么是 mongo-express?

mongo-express 是一个基于 Web 的 MongoDB 管理界面,用 Node.js、Express.js 和 Bootstrap3 编写。

github.com/mongo-express/mongo-express

logo

如何使用此图像

$ docker run --network some-network -e ME_CONFIG_MONGODB_SERVER=some-mongo -p 8081:8081 mongo-express

然后你可以在你的浏览器中点击 http://localhost:8081http://host-ip:8081

安全通知

JSON 文档通过 JavaScript 虚拟机进行解析,因此网络界面可用于在服务器上执行恶意 JavaScript。

mongo-express 仅应在私下用于开发目的。

配置

环境变量被传递给 run 命令以配置一个 mongo-express 容器。

Name                            | Default         | Description
--------------------------------|-----------------|------------
ME_CONFIG_BASICAUTH_USERNAME    | ''              | mongo-express web username
ME_CONFIG_BASICAUTH_PASSWORD    | ''              | mongo-express web password
ME_CONFIG_MONGODB_ENABLE_ADMIN  | 'true'          | Enable admin access to all databases. Send strings: `"true"` or `"false"`
ME_CONFIG_MONGODB_ADMINUSERNAME | ''              | MongoDB admin username
ME_CONFIG_MONGODB_ADMINPASSWORD | ''              | MongoDB admin password
ME_CONFIG_MONGODB_PORT          | 27017           | MongoDB port
ME_CONFIG_MONGODB_SERVER        | 'mongo'         | MongoDB container name. Use comma delimited list of host names for replica sets.
ME_CONFIG_OPTIONS_EDITORTHEME   | 'default'       | mongo-express editor color theme, [more here](http://codemirror.net/demo/theme.html)
ME_CONFIG_REQUEST_SIZE          | '100kb'         | Maximum payload size. CRUD operations above this size will fail in [body-parser](https://www.npmjs.com/package/body-parser).
ME_CONFIG_SITE_BASEURL          | '/'             | Set the baseUrl to ease mounting at a subdirectory. Remember to include a leading and trailing slash.
ME_CONFIG_SITE_COOKIESECRET     | 'cookiesecret'  | String used by [cookie-parser middleware](https://www.npmjs.com/package/cookie-parser) to sign cookies.
ME_CONFIG_SITE_SESSIONSECRET    | 'sessionsecret' | String used to sign the session ID cookie by [express-session middleware](https://www.npmjs.com/package/express-session).
ME_CONFIG_SITE_SSL_ENABLED      | 'false'         | Enable SSL.
ME_CONFIG_SITE_SSL_CRT_PATH     | ''              | SSL certificate file.
ME_CONFIG_SITE_SSL_KEY_PATH     | ''              | SSL key file.

以下内容仅在 ME_CONFIG_MONGODB_ENABLE_ADMIN 为“false”时才需要

Name                            | Default         | Description
--------------------------------|-----------------|------------
ME_CONFIG_MONGODB_AUTH_DATABASE | 'db'            | Database name
ME_CONFIG_MONGODB_AUTH_USERNAME | 'admin'         | Database username
ME_CONFIG_MONGODB_AUTH_PASSWORD | 'pass'          | Database password

示例

$ docker run -it --rm \
    --network web_default \
    --name mongo-express \
    -p 8081:8081 \
    -e ME_CONFIG_OPTIONS_EDITORTHEME="ambiance" \
    -e ME_CONFIG_MONGODB_SERVER="web_db_1" \
    -e ME_CONFIG_BASICAUTH_USERNAME="user" \
    -e ME_CONFIG_BASICAUTH_PASSWORD="fairly long password" \
    mongo-express

此示例链接到一个典型的 docker-compose 的容器名称,更改编辑器的颜色主题,并启用基本身份验证。

许可证

查看此映像中包含的软件的许可证信息。

与所有 Docker 镜像一样,这些镜像可能还包含其他可能受其他许可证约束的软件(例如来自基础发行版的 Bash 等,以及所包含的主要软件的任何直接或间接依赖项)。

一些能够自动检测到的额外许可证信息可能会在 repo-info 存储库的 mongo-express/ 目录中找到。

对于任何预构建镜像的使用,镜像用户有责任确保对此镜像的任何使用都符合其中包含的所有软件的任何相关许可证。