Docker-Compose Quickstart Setup - Edge Controller Issue

Well, that was easy enough, there is an issue with the docs, the service name is indented more than it should be so I’m fairly confident this is your issue. Here is a screenshot of what it should look like.

My suggestion (until I get the doc fixed) would be to look at the services above it, anything with the same name should be indented to the same level, so make sure the service name ziti-console is in-line with the service above (in my case web-test-blue above). Same with image, ports, etc. The issue with the copied code is that the service name.

To hopefully make it even simpler (assuming the formatting carries over properly, here is what the correct indentation should be so you can try to copy and paste this.

  ziti-console:
    image: openziti/zac
    ports:
      - "1408:1408"
      - "8443:8443"
    environment:
      - ZITI_EDGE_CONTROLLER_HOSTNAME=ziti-edge-router
    volumes:
      - ziti-fs:/openziti
      - type: bind
        source: ./ziti-edge-controller-server.key
        target: /usr/src/app/server.key
      - type: bind
        source: ./ziti-edge-controller-server.chain.pem
        target: /usr/src/app/server.chain.pem

The doc formatting for that service is fixed so copying and pasting should work now, just be sure to also copy the spaces before ziti-console along with everything else.

1 Like

Thanks Heaps @gberl002 ! that fixed it.

1 Like

@TheLumberjack
So, I was thinking about how we can make this better. I think we should put the bind commands in the docker-compose file by default, but have them commented out. Then, update the documentation to just remove the # character at the beginning of the line. This will reduce typos, improve quickstart time etc. I had a look for where the docker-compose is coming from, and I think it is from the main Ziti project- is that correct? Once that is done, then we update the documentation as appropriate. thoughts? I must admit I didn’t pick the doco issue up, as I just copy the volumes bit out, and didn’t see the issue.

I don’t mind updating the documentation, if you are OK updating the docker-compose file.

Add something like the following:

  ziti-console:
    image: openziti/zac
    ports:
      - "1408:1408"
      - "8443:8443"
    environment:
      - ZITI_EDGE_CONTROLLER_HOSTNAME=ziti-edge-router
#  See https://openziti.github.io/ziti/quickstarts/zac/installation.html#using-docker-compose for details
#    volumes:
#      - ziti-fs:/openziti
#      - type: bind
#        source: ./ziti-edge-controller-server.key
#        target: /usr/src/app/server.key
#      - type: bind
#        source: ./ziti-edge-controller-server.chain.pem
#        target: /usr/src/app/server.chain.pem
...

Is there any way to restart automatically too? something like restart: unless-stopped

If you want it to always restart, use

restart: always

Otherwise, doing docker updates or restarts can stop the containers and not restart it. You need to add this against each service in the docker-compose file.

Are you suggesting that we put these commands in the docker-compose as well? My thought is be that this is a quickstart and not a production deployment, so probably not required.

yes.

Sounds like it might be an improvement to me, yes. I can see the sample docker file @gberl002 included in this page is not the same as what's currently checked in https://github.com/openziti/ziti/blob/release-next/quickstart/docker/docker-compose.yml#L144-L154

I'm all for simpler and I have a preference to keep options able to be commented out in that way to make it easier to explore the file and understand what it does. I think maybe I'll have to talk to @gberl002 and understand it better. Overall though - I'm for anything that makes it easier to use. :slight_smile:

Thanks!