From f642de22c5bef60f3ed06a4ee5d71a7a53a85708 Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Tue, 30 Apr 2024 21:37:29 -0400 Subject: [PATCH] eliminate ziti steps --- docker/compose/zrok-instance/README.md | 11 ++--------- docker/compose/zrok-instance/compose.yml | 19 +++---------------- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/docker/compose/zrok-instance/README.md b/docker/compose/zrok-instance/README.md index beea946c..46c31b5e 100644 --- a/docker/compose/zrok-instance/README.md +++ b/docker/compose/zrok-instance/README.md @@ -53,8 +53,6 @@ CADDY_DNS_PLUGIN=cloudflare CADDY_DNS_PLUGIN_TOKEN=abcd1234 CADDY_ACME_EMAIL=me@example.com -# this must == ziti.${ZROK_DNS_ZONE} -ZITI_CTRL_ADVERTISED_ADDRESS=ziti.share.example.com ZITI_PWD=zitiadminpw ZROK_ADMIN_TOKEN=zroktoken @@ -62,6 +60,7 @@ ZROK_USER_PWD=zrokuserpw ``` ```bash title=".env options" +# ziti ports ZITI_CTRL_ADVERTISED_PORT=1280 ZITI_ROUTER_PORT=3022 @@ -78,18 +77,12 @@ CADDY_ACME_API=https://acme-staging-v02.api.letsencrypt.org/directory ### Start the Docker Compose Project -1. Start the ziti network. This runs `ziti edge quickstart` ([link to readme](https://github.com/openziti/ziti/tree/main/quickstart/docker/all-in-one#readme)). - - ```bash - docker compose --profile ziti up --detach - ``` - 1. Start the zrok instance. The container images for zrok (including caddy) are built in this step. This provides a simple configuration to get started. You can modify the templates named like `*.envsubst` or mount a customized configuration file to mask the one that was built in. ```bash - docker compose --profile zrok up --build --detach + docker compose up --build --detach ``` ### Set up a User Account diff --git a/docker/compose/zrok-instance/compose.yml b/docker/compose/zrok-instance/compose.yml index d484ffb8..bd69780b 100644 --- a/docker/compose/zrok-instance/compose.yml +++ b/docker/compose/zrok-instance/compose.yml @@ -4,23 +4,20 @@ services: ziti-quickstart: image: ${ZITI_CLI_IMAGE:-docker.io/openziti/ziti-cli}:${ZITI_CLI_TAG:-latest} - profiles: - - ziti restart: unless-stopped networks: zrok-instance: # this allows other containers to use the same external DNS name to reach the quickstart container from within the # Docker network that clients outside the Docker network use to reach the quickstart container via port forwarding aliases: - - ${ZITI_CTRL_ADVERTISED_ADDRESS:-ziti-controller} - - ${ZITI_ROUTER_ADVERTISED_ADDRESS:-ziti-router} + - ziti.${ZROK_DNS_ZONE} entrypoint: - bash - -euc - | - ZITI_CMD+=" --ctrl-address ${ZITI_CTRL_ADVERTISED_ADDRESS:-ziti-quickstart}"\ + ZITI_CMD+=" --ctrl-address ziti.${ZROK_DNS_ZONE}"\ " --ctrl-port ${ZITI_CTRL_ADVERTISED_PORT:-1280}"\ - " --router-address ${ZITI_ROUTER_ADVERTISED_ADDRESS:-${ZITI_CTRL_ADVERTISED_ADDRESS:-ziti-quickstart}}"\ + " --router-address ziti.${ZROK_DNS_ZONE}"\ " --router-port ${ZITI_ROUTER_PORT:-3022}"\ " --password ${ZITI_PWD:-admin}" echo "DEBUG: run command is: ziti $${@} $${ZITI_CMD}" @@ -71,16 +68,12 @@ services: # add a health check for the quickstart network ziti-quickstart-check: image: busybox - profiles: - - ziti command: echo "Ziti is cooking" depends_on: ziti-quickstart: condition: service_healthy zrok-permissions: - profiles: - - zrok image: busybox command: - /bin/sh @@ -93,8 +86,6 @@ services: - zrok_frontend:/var/lib/zrok-frontend zrok-controller: - profiles: - - zrok depends_on: zrok-permissions: condition: service_completed_successfully @@ -128,8 +119,6 @@ services: CADDY_ACME_EMAIL: ${CADDY_ACME_EMAIL} # login email address (initial user account) zrok-frontend: - profiles: - - zrok depends_on: zrok-permissions: condition: service_completed_successfully @@ -169,8 +158,6 @@ services: ZITI_PWD: ${ZITI_PWD} # ziti controller admin password caddy: - profiles: - - zrok build: context: . dockerfile: ./caddy.Dockerfile