kube-cascade/ytmd/docker-compose.yaml

50 lines
1.4 KiB
YAML
Raw Permalink Normal View History

2023-04-27 23:53:09 +00:00
# cloudflared tunnel create ytmd
# cloudflared tunnel route dns ytmd ytmd.strudelline.net
# cp ~/.cloudflared/*.json /Volumes/webdav.strudelline.net/docker-compose-mounts/cloudflared
#
# grab the tunnel-id that's output from the first two commands and open this file again
# add the tunnel-id to TUNNELID below
version: '3'
volumes:
config: {}
services:
main:
image: ghcr.io/jamesandariese/ytmd-api:main
restart: always
environment:
- "HOST=127.0.0.1"
cloudflared-configurator:
image: debian:11
environment:
- TUNNELID=4f3aba1c-c226-4e14-800f-ad4b8d30dc60
- HOST=ytmd.strudelline.net
- SVCPORT=8000
command:
- bash
- -c
- |
cat /cloudflared/$${TUNNELID}.json > /config/tunnel.json
cat << EOF > /config/cloudflared.yaml
tunnel: $${TUNNELID}
credentials-file: /config/tunnel.json
ingress:
- hostname: ytmd.strudelline.net
service: http://localhost:$${SVCPORT}
- service: http_status:404
EOF
volumes:
- /volume1/docker-compose-mounts/cloudflared:/cloudflared
- config:/config
cloudflared:
image: cloudflare/cloudflared:latest
restart: always
depends_on: {"cloudflared-configurator": {"condition": "service_completed_successfully"}}
volumes:
- config:/config
command: tunnel --config /config/cloudflared.yaml run
network_mode: service:main