mirror of
https://github.com/openziti/zrok.git
synced 2025-01-21 21:38:50 +01:00
add Docker Compose projects for public share, private share, and private access
This commit is contained in:
parent
838d1bfd43
commit
3edf428bbb
25
docker-images/zrok-private-access/docker-compose.yml
Normal file
25
docker-images/zrok-private-access/docker-compose.yml
Normal file
@ -0,0 +1,25 @@
|
||||
version: '3'
|
||||
services:
|
||||
zrok-private-access:
|
||||
# build: .
|
||||
image: docker.io/openziti/zrok
|
||||
user: root
|
||||
command: access private --bind 0.0.0.0:9191 ${ZROK_PRIVATE_ACCESS_TOKEN}
|
||||
ports:
|
||||
- 9191:9191
|
||||
stdin_open: true
|
||||
tty: true
|
||||
volumes:
|
||||
- ${HOME}/.zrok:/mnt/.zrok
|
||||
environment:
|
||||
HOME: /mnt
|
||||
PFXLOG_NO_JSON: "true"
|
||||
ZROK_PRIVATE_ACCESS_TOKEN:
|
||||
busybox:
|
||||
image: busybox
|
||||
command: >
|
||||
sh -c "while true; do
|
||||
echo 'INFO: trying wget';
|
||||
wget -q -O - http://zrok-private-access:9191/get;
|
||||
sleep 3;
|
||||
done"
|
39
docker-images/zrok-private-share/docker-compose.yml
Normal file
39
docker-images/zrok-private-share/docker-compose.yml
Normal file
@ -0,0 +1,39 @@
|
||||
version: '3'
|
||||
services:
|
||||
zrok-enable-init:
|
||||
image: busybox
|
||||
command: chown -Rc 65534:65534 /mnt/.zrok
|
||||
user: root
|
||||
volumes:
|
||||
- zrok_env:/mnt/.zrok
|
||||
zrok-enable:
|
||||
depends_on: ["zrok-enable-init"]
|
||||
image: docker.io/openziti/zrok
|
||||
command: enable ${ZROK_ENABLE_TOKEN}
|
||||
stdin_open: true
|
||||
tty: true
|
||||
volumes:
|
||||
- zrok_env:/mnt/.zrok
|
||||
environment:
|
||||
HOME: /mnt
|
||||
ZROK_ENABLE_TOKEN:
|
||||
ZROK_API_ENDPOINT: https://api.staging.zrok.io/
|
||||
zrok-private-share:
|
||||
# build: .
|
||||
image: docker.io/openziti/zrok
|
||||
user: root
|
||||
command: share private --headless http://httpbin-test:8080
|
||||
depends_on: []
|
||||
volumes:
|
||||
- ${HOME}/.zrok:/mnt/.zrok
|
||||
environment:
|
||||
HOME: /mnt
|
||||
PFXLOG_NO_JSON: "true"
|
||||
zrok-test:
|
||||
image: docker.io/openziti/zrok
|
||||
command: test endpoint --verbose --address 0.0.0.0
|
||||
httpbin-test:
|
||||
image: mccutchen/go-httpbin # 8080/tcp
|
||||
|
||||
volumes:
|
||||
zrok_env:
|
58
docker-images/zrok-public-share/docker-compose.yml
Normal file
58
docker-images/zrok-public-share/docker-compose.yml
Normal file
@ -0,0 +1,58 @@
|
||||
version: '3'
|
||||
services:
|
||||
zrok-enable-init:
|
||||
image: busybox
|
||||
# matches uid:gid of "nobody" in zrok container image
|
||||
command: chown -Rc 65534:65534 /mnt/.zrok
|
||||
user: root
|
||||
volumes:
|
||||
- zrok_env:/mnt/.zrok
|
||||
zrok-enable:
|
||||
depends_on:
|
||||
zrok-enable-init:
|
||||
condition: service_completed_successfully
|
||||
entrypoint:
|
||||
- bash
|
||||
- -c
|
||||
- |
|
||||
# set -x
|
||||
if [[ -s /mnt/.zrok/environment.json ]]; then
|
||||
echo "INFO: noop: zrok environment is already enabled"
|
||||
exit 0
|
||||
else
|
||||
echo "INFO: running: zrok $$(sed -E 's/[a-zA-Z0-9]{12,}/************/' <<< $${@})"
|
||||
exec zrok $${@}
|
||||
fi
|
||||
command: -- enable --headless ${ZROK_ENABLE_TOKEN}
|
||||
stdin_open: true # FIXME: remove when --headless is available
|
||||
tty: true # FIXME: remove when --headless is available
|
||||
volumes:
|
||||
- zrok_env:/mnt/.zrok
|
||||
environment:
|
||||
HOME: /mnt
|
||||
ZROK_ENABLE_TOKEN:
|
||||
ZROK_API_ENDPOINT: https://api.staging.zrok.io/
|
||||
zrok-public-share:
|
||||
image: docker.io/openziti/zrok
|
||||
command: share public --headless http://httpbin-test:8080
|
||||
depends_on:
|
||||
zrok-enable:
|
||||
condition: service_completed_successfully
|
||||
volumes:
|
||||
- zrok_env:/mnt/.zrok
|
||||
environment:
|
||||
HOME: /mnt
|
||||
PFXLOG_NO_JSON: "true"
|
||||
volumes:
|
||||
- zrok_env:/mnt/.zrok
|
||||
environment:
|
||||
HOME: /mnt
|
||||
PFXLOG_NO_JSON: "true"
|
||||
zrok-test:
|
||||
image: docker.io/openziti/zrok
|
||||
command: test endpoint --address 0.0.0.0
|
||||
httpbin-test:
|
||||
image: mccutchen/go-httpbin # 8080/tcp
|
||||
|
||||
volumes:
|
||||
zrok_env:
|
Loading…
Reference in New Issue
Block a user