diff options
| author | Bobby <[email protected]> | 2025-04-13 20:05:06 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2025-04-13 20:05:06 +0530 |
| commit | 1aedab4beeac7f6a457e0f20ef22069d3e86d3d8 (patch) | |
| tree | 7509067445d5466eee091ff72495b5648df598e8 | |
| parent | b57cf11d72fdd00199cfc9df6679d894012f56d9 (diff) | |
| download | ai-1aedab4beeac7f6a457e0f20ef22069d3e86d3d8.tar.xz ai-1aedab4beeac7f6a457e0f20ef22069d3e86d3d8.zip | |
use cloudflare warp before starting bot
| -rw-r--r-- | Dockerfile | 23 |
1 files changed, 11 insertions, 12 deletions
@@ -24,27 +24,26 @@ FROM alpine:3.21 WORKDIR /app # Install runtime dependencies -RUN apk add --no-cache ffmpeg python3 py3-pip opus opus-dev ca-certificates \ +RUN apk add --no-cache ffmpeg python3 py3-pip opus opus-dev ca-certificates curl \ && python3 -m venv /venv \ && . /venv/bin/activate \ && pip install --no-cache-dir yt-dlp \ && ln -s /venv/bin/yt-dlp /usr/local/bin/yt-dlp \ && mkdir -p /app/temp +# Install cloudflared (ARM64) +RUN curl -LO https://github.com/cloudflare/cloudflared/releases/download/2025.4.0/cloudflared-linux-arm64 \ + && chmod +x cloudflared-linux-arm64 \ + && mv cloudflared-linux-arm64 /usr/local/bin/cloudflared + # Copy the binary from the builder stage COPY --from=builder /app/ai/ai . # Copy environment variables file -# Note: You can also use CapRover environment variables instead COPY .env.example .env -# Expose port 80 for CapRover health checks -# The application doesn't need to use this port, it's just for health checks -EXPOSE 80 - -# Create a simple health check endpoint -RUN echo '#!/bin/sh\nwhile true; do echo -e "HTTP/1.1 200 OK\n\nOK" | nc -l -p 80; done' > /app/healthcheck.sh && \ - chmod +x /app/healthcheck.sh - -# Start both the health check service and the application -CMD /app/healthcheck.sh & ./ai
\ No newline at end of file +# Start cloudflared WARP and then launch the bot +CMD sh -c "\ + cloudflared tunnel --url http://localhost:8080 --no-autoupdate & \ + sleep 5 && \ + ./ai" |
