使用 Docker 在 Salesforce 中安装应用程序时,“不允许使用(根)附加属性 nginx”

0 github nginx salesforce docker

我正在关注本教程https://trailhead.salesforce.com/en/content/learn/modules/user-interface-api/install-sample-app?trail_id=force_com_dev_intermediate并且我以前从未使用过 docker。我遵循的步骤:

  1. 克隆存储库
  2. 安装了docker for windows,完美安装。
  3. 尝试在存储库docker-compose build && docker-compose up -d上运行此 cmd 运行此 cmd 时,我收到相同的错误。E:\Salesforce\RecordViewer>docker-compose build && docker-compose up -d (root) 不允许附加属性 nginx

小智 7

我找到了这个答案:https ://stackoverflow.com/a/38717336/279771

基本上我需要添加services:到 docker-compose.yml 中,所以它看起来像这样:

services:
  web:
    build: .
    command: 'bash -c ''node app.js'''
    working_dir: /usr/src/app
    environment:
      PORT: 8050
      NGINX_PORT: 8443
    volumes:
      - './views:/app/user/views:ro'
  nginx:
    build: nginx
    ports:
      - '8080:80'
      - '8443:443'
    links:
      - web:web
    volumes_from:
      - web

Run Code Online (Sandbox Code Playgroud)