ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developersโ€ข2y agoโ€ข
2 replies
Bjarn

cloudflared tunnel via Docker

Hi!

I am using cloudflared in a Docker compose file with the following configuration.

version: '1.0'
services:
  app:
    container_name: XXX
    image: ghcr.io/XXX/XXX:main
    # restart: unless-stopped
    ports:
      - "3000:3000"
    networks:
        - app
  tunnel:
    container_name: cloudflared-tunnel
    image: cloudflare/cloudflared
    # restart: unless-stopped
    command: tunnel run
    environment:
      - TUNNEL_TOKEN=XXXX
    networks:
        - app

networks:
  app:
    name: app
version: '1.0'
services:
  app:
    container_name: XXX
    image: ghcr.io/XXX/XXX:main
    # restart: unless-stopped
    ports:
      - "3000:3000"
    networks:
        - app
  tunnel:
    container_name: cloudflared-tunnel
    image: cloudflare/cloudflared
    # restart: unless-stopped
    command: tunnel run
    environment:
      - TUNNEL_TOKEN=XXXX
    networks:
        - app

networks:
  app:
    name: app


My problem here is that it keeps throwing the following errors even though it seems to work just fine (request come through and app is served correctly). However, when enabling "restart: unless-stopped", it doesn't work as it keeps restarting.

Wasn't able to find anything on this. Really appreciate the help!

cloudflared-tunnel  | 2024-03-08T21:01:06Z ERR Request failed error="context canceled" connIndex=1 dest=https://XXXX/ event=0 ip=XXXX type=http
cloudflared-tunnel  | 2024-03-08T21:06:05Z ERR  error="context canceled" connIndex=1 event=1 ingressRule=2 originService=http://app:3000
cloudflared-tunnel  | 2024-03-08T21:01:06Z ERR Request failed error="context canceled" connIndex=1 dest=https://XXXX/ event=0 ip=XXXX type=http
cloudflared-tunnel  | 2024-03-08T21:06:05Z ERR  error="context canceled" connIndex=1 event=1 ingressRule=2 originService=http://app:3000
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Docker Container Cloudflared Tunnel
Cloudflare DevelopersCDCloudflare Developers / general-help
2mo ago
tunnel cloudflared
Cloudflare DevelopersCDCloudflare Developers / general-help
17mo ago
Synology DSM access via cloudflared tunnel
Cloudflare DevelopersCDCloudflare Developers / general-help
2y ago
RDP via Cloudflared Tunnel is Slow.
Cloudflare DevelopersCDCloudflare Developers / general-help
3y ago