mirror of
https://github.com/openziti/ziti.git
synced 2026-10-13 15:51:21 +00:00
89 lines
3.2 KiB
YAML
89 lines
3.2 KiB
YAML
services:
|
|
quickstart:
|
|
image: ${ZITI_QUICK_IMAGE:-docker.io/openziti/ziti-cli}:${ZITI_QUICK_TAG:-latest}
|
|
restart: unless-stopped
|
|
build:
|
|
# the build context is the root of the ziti repo so that BuildKit can access the built ziti executable in /build
|
|
# and the Dockerfile
|
|
context: ../../../
|
|
dockerfile: ./quickstart/docker/all-in-one/Dockerfile
|
|
args:
|
|
# path of the directory containing the locally-built ziti executable; relative to the build context
|
|
ARTIFACTS_DIR: ./build
|
|
networks:
|
|
quickstart:
|
|
# 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:
|
|
- ${EXTERNAL_DNS:-null}
|
|
entrypoint:
|
|
- bash
|
|
- -euc
|
|
- |
|
|
ZITI_CMD+=" --ctrl-address ${EXTERNAL_DNS:-quickstart}"\
|
|
" --ctrl-port ${ZITI_CTRL_ADVERTISED_PORT:-1280}"\
|
|
" --router-address ${EXTERNAL_DNS:-quickstart}"\
|
|
" --router-port ${ZITI_ROUTER_PORT:-3022}"\
|
|
" --password ${ZITI_PWD:-admin}"
|
|
echo "DEBUG: run command is: ziti $${@} $${ZITI_CMD}"
|
|
exec ziti "$${@}" $${ZITI_CMD}
|
|
command: -- edge quickstart --home /home/ziggy/quickstart
|
|
user: ${ZIGGY_UID:-1000}
|
|
environment:
|
|
HOME: /home/ziggy
|
|
PFXLOG_NO_JSON: "${PFXLOG_NO_JSON:-true}"
|
|
ZITI_ROUTER_NAME: ${ZITI_ROUTER_NAME:-quickstart-router}
|
|
volumes:
|
|
# store the quickstart state in a named volume "ziti_home" or store the quickstart state on the Docker host in a
|
|
# directory, ZITI_HOME
|
|
- ${ZITI_HOME:-ziti_home}:/home/ziggy
|
|
ports:
|
|
- ${ZITI_INTERFACE:-0.0.0.0}:${ZITI_CTRL_ADVERTISED_PORT:-1280}:${ZITI_CTRL_ADVERTISED_PORT:-1280}
|
|
- ${ZITI_INTERFACE:-0.0.0.0}:${ZITI_ROUTER_PORT:-3022}:${ZITI_ROUTER_PORT:-3022}
|
|
expose:
|
|
- ${ZITI_CTRL_ADVERTISED_PORT:-1280}
|
|
- ${ZITI_ROUTER_PORT:-3022}
|
|
depends_on:
|
|
quickstart-init:
|
|
condition: service_completed_successfully
|
|
healthcheck:
|
|
test:
|
|
- CMD
|
|
- ziti
|
|
- agent
|
|
- stats
|
|
interval: 3s
|
|
timeout: 3s
|
|
retries: 5
|
|
start_period: 30s
|
|
|
|
# this service is used to initialize the ziti_home volume by setting the owner to the UID of the user running the
|
|
# quickstart container
|
|
quickstart-init:
|
|
image: busybox
|
|
command: chown -Rc ${ZIGGY_UID:-1000} /home/ziggy
|
|
user: root
|
|
environment:
|
|
HOME: /home/ziggy
|
|
volumes:
|
|
# store the quickstart state in a named volume "ziti_home" or store the quickstart state on the Docker host in a
|
|
# directory, ZITI_HOME
|
|
- ${ZITI_HOME:-ziti_home}:/home/ziggy
|
|
|
|
# add a health check for the quickstart network
|
|
quickstart-check:
|
|
image: busybox
|
|
command: echo "Ziti is cooking"
|
|
depends_on:
|
|
quickstart:
|
|
condition: service_healthy
|
|
|
|
# define a custom network so that we can also define a DNS alias for the quickstart container
|
|
networks:
|
|
quickstart:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
# this will not be used if you switch from named volume to bind mount volume
|
|
ziti_home:
|
|
driver: local |