add tunnel-only setup with host network mode, including updated Dockerfile, docker-compose, and configuration files

This commit is contained in:
2025-11-01 00:55:04 +05:30
parent fbafab5d51
commit 6ef2edb768
5 changed files with 174 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
# Tunnel-only Dockerfile V2 - Uses localhost with host network mode
FROM alpine:latest
# Install wget to download cloudflared
RUN apk update && apk add --no-cache wget ca-certificates
# Get cloudflared directly from GitHub
RUN wget -O cloudflared https://github.com/cloudflare/cloudflared/releases/download/2023.5.0/cloudflared-linux-amd64 && \
chmod +x cloudflared && \
mv cloudflared /usr/local/bin/
# Create directories for cloudflared
RUN mkdir -p /etc/cloudflared
# Copy the certificate file and config
COPY cert.pem /etc/cloudflared/cert.pem
COPY credentials.json /etc/cloudflared/credentials.json
COPY config.tunnel-only-v2.json /etc/cloudflared/config.json
# Setup DNS routing for the tunnel (only needs to be done once)
RUN cloudflared tunnel route dns 5d2682ef-0b5b-47e5-b0fa-ad48968ce016 api.ishikabhoyar.tech || echo "DNS routing already set up or failed - continuing anyway"
# Run cloudflared tunnel
CMD ["cloudflared", "tunnel", "--config", "/etc/cloudflared/config.json", "run"]