From 0fbdd83dd73e9ebe043b525fdcc54f9a28188089 Mon Sep 17 00:00:00 2001 From: Bobby Date: Sun, 13 Apr 2025 20:21:34 +0530 Subject: revert back dockerfile --- Dockerfile | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 69ed96d..d7d70fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,26 +24,27 @@ FROM alpine:3.21 WORKDIR /app # Install runtime dependencies -RUN apk add --no-cache ffmpeg python3 py3-pip opus opus-dev ca-certificates curl \ +RUN apk add --no-cache ffmpeg python3 py3-pip opus opus-dev ca-certificates \ && 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 -# Start cloudflared WARP and then launch the bot -CMD sh -c "\ - cloudflared tunnel --url http://localhost:8080 --no-autoupdate & \ - sleep 5 && \ - ./ai" +# 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 -- cgit v1.2.3