Thank you for your prompt response! I've finally had the time to set things up.
I've successfully got a website configured the way I want with Zrok (routing from my home to my server and working with Traefik to display on a particular sub domain). However, I'm running into a small problem. I wish to use the same Zrok share container on my desktop PC to share multiple services at once (versus creating multiple share container config sections). For testing purposes, I wish to share both a website and a Minecraft server. However, this does not seem possible with the way the way Docker and the Zrok container are setup. I'll try to illustrate my point below.
The following is a portion of my current docker-compose.yml
from my desktop PC.
zrok-share:
image: ${ZROK_CONTAINER_IMAGE:-docker.io/openziti/zrok}
entrypoint:
- bash
- -euxc
- |
echo "DEBUG: HOME=$${HOME}"
ls -lA /mnt/.zrok/
exec zrok $${@}
command:
- share private --headless --backend-mode proxy ${ZROK_TARGET:-http://ai:7860/}
- share private --headless --backend-mode tcpTunnel test_server:25565
depends_on:
zrok-enable:
condition: service_completed_successfully
volumes:
- ./zrok_env:/mnt
environment:
HOME: /mnt
PFXLOG_NO_JSON: "true"
networks:
- servnet
Please observe how the only difference from what I had working before is the addition of the second line under command
. When Docker launches the container, only the second line is read and thus only the Minecraft server is published. The previous line publishing the AI web UI is ignored. I attempted to work around this by changing the command to use bash. That unfortunately didn't work as it seems command
can only accept a single set of Zrok arguments.
To clarify what I'm saying, when command
is set to as follows...
command: bash -c "zrok share private --headless --backend-mode proxy ${ZROK_TARGET:-http://ai:7860/} && zrok share private --headless --backend-mode tcpTunnel test_server:25565"
These are the logs from zrok-zrok-share-1
:
+ echo 'DEBUG: HOME=/mnt'
+ ls -lA /mnt/.zrok/
DEBUG: HOME=/mnt
total 12
-rw------- 1 ziggy ziggy 52 May 27 07:48 config.json
-rw------- 1 ziggy ziggy 116 May 27 07:48 environment.json
drwx------ 1 ziggy ziggy 32 May 27 07:48 identities
-rw------- 1 ziggy ziggy 12 May 27 07:48 metadata.json
+ exec zrok -c zrok share private --headless --backend-mode proxy http://ai:7860/ '&&' zrok share private --headless --backend-mode proxy localhost:25565
Error: unknown shorthand flag: 'c' in -c
Usage:
zrok share private [<target>] [flags]
Flags:
--access-grant stringArray zrok accounts that are allowed to access this share (see --closed)
-b, --backend-mode string The backend mode {proxy, web, tcpTunnel, udpTunnel, caddy, drive, socks, vpn} (default "proxy")
--basic-auth stringArray Basic authentication users (<username:password>,...
--closed Enable closed permission mode (see --access-grant)
--headless Disable TUI and run headless
-h, --help help for private
--insecure Enable insecure TLS certificate validation for <target>
Global Flags:
-p, --panic Panic instead of showing pretty errors
-v, --verbose Enable verbose logging
[ERROR]: an error occurred (unknown shorthand flag: 'c' in -c)
While I guess creating copies of the zrok-share
section may be the way to go, I'm wondering if I can simply the config by achieving execution of multiple Zrok share commands under a single section.