add tunnel-only setup with Docker, including Dockerfile, docker-compose, and scripts

This commit is contained in:
2025-11-01 00:49:59 +05:30
parent a433c5067f
commit fbafab5d51
7 changed files with 331 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
# Tunnel-only Dockerfile - Backend runs outside Docker on port 9090
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.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"]