Examples
Examples

Examples

This page contains common Docker Compose examples for Docker Cloudflare Tunnel Sync.

Basic HTTP service

1
2
3
4
5
6
7
services:
  whoami:
    image: traefik/whoami
    labels:
      cloudflare.tunnel.enable: "true"
      cloudflare.tunnel.hostname: whoami.example.test
      cloudflare.tunnel.service: http://whoami:80

Service with a path prefix

1
2
3
4
5
6
7
8
services:
  api:
    image: nginx
    labels:
      cloudflare.tunnel.enable: "true"
      cloudflare.tunnel.hostname: app.example.test
      cloudflare.tunnel.path: /api
      cloudflare.tunnel.service: http://api:80

Multiple routes on one container

1
2
3
4
5
6
7
8
9
services:
  app:
    image: nginx
    labels:
      cloudflare.tunnel.enable: "true"
      cloudflare.tunnel.hostname: app.example.test
      cloudflare.tunnel.service: http://app:80
      cloudflare.tunnel.hostname.admin: admin.example.test
      cloudflare.tunnel.service.admin: http://app:8080

HTTPS origin with custom SNI

1
2
3
4
5
6
7
8
9
services:
  app:
    image: nginx
    labels:
      cloudflare.tunnel.enable: "true"
      cloudflare.tunnel.hostname: app.example.test
      cloudflare.tunnel.service: https://app:443
      cloudflare.tunnel.origin.server-name: app.internal
      cloudflare.tunnel.origin.no-tls-verify: "true"