configure Cloudflare tunnels and apply access application policies via docker labels
3.1K
Overview docker-dash is a dynamic configuration service that automatically creates and manages Cloudflare Tunnels and Access Applications based on Docker container labels. It listens to the Docker event stream for container start/stop events and configures public hostnames and access policies in Cloudflare accordingly, providing a "set-it-and-forget-it" solution for exposing your services securely.
Features Automated Ingress Rules: Automatically creates Cloudflare Tunnel ingress rules for your services. Automated CNAME Records: Automatically creates CNAME records for your services. Automated Access Applications: Automatically creates and infigures Cloudflare Access Applications to secure your public routes. Label-Driven Configuration: Use Docker labels as the single source of truth for all configurations. Live State Caching: Maintains an in-memory cache of your Cloudflare configuration for efficient updates. Web UI: lightweight web interface to view the application's cached state for easy troubleshooting. Usage
Docker Compose Example version: '3.8'
services: docker-dash: container_name: docker-dash image: amoisis/docker-dash:latest # Replace with your image if building locally restart: unless-stopped ports: - "3445:3445" environment: # Required Cloudflare Credentials - CF_API_TOKEN=your_cloudflare_api_token - CF_ACCOUNT_ID=your_cloudflare_account_id
# Set to DEBUG to enable the web UI
- LOG_LEVEL=INFO
volumes:
# Required to listen to Docker events
# Option 1: Mount the Docker socket directly (default)
- /var/run/docker.sock:/var/run/docker.sock:ro
# Option 2: Use a Docker socket proxy
# environment:
# - DOCKER_HOST=tcp://<proxy-host>:<proxy-port>
Environment Variables Variable Required Description CF_API_TOKEN Yes Your Cloudflare API Token with the required permissions. CF_ACCOUNT_ID Yes Your Cloudflare Account ID. LOG_LEVEL No . Defaults to INFO. Configuration via Docker Labels The entire configuration is managed by adding labels to the Docker containers you wish to expose.
Core Routing Labels Label Required Example Description docker.dash.enable Yes true Must be set to "true" for docker-dash to process the container. docker.dash.tunnel Yes my-tunnel-name The name of the Cloudflare Tunnel to add the route to. docker.dash.hostname Yes app.example.com The public hostname for the service. docker.dash.service Yes http://app-container:8080 The internal service URL that the tunnel will proxy to. Access Application Labels (Optional) These labels allow you to automatically secure the public hostname with a Cloudflare Access Application Policies.
Label Example Description docker.dash.application.access.policy Allow-Admins,Bypass-Internal A comma-separated list of Access Policy names to apply. The order determines the precedence. docker.dash.application.access.loginmethods AzureAD A comma-separated list of Identity Provider names to allow for login. docker.dash.application.access.instantauth true If set to "true" and only one login method is specified, users will be redirected to it instantly, skipping the login method selection screen. docker.dash.application.access.icon https://example.com/icon.png A URL for the icon to display on the App Launcher.
Content type
Image
Digest
sha256:770e0f21a…
Size
59.7 MB
Last updated
2 months ago
docker pull amoisis/docker-dash