Add Dockerfile and Makefile for cloudflared tunnel setup; include startup script

This commit is contained in:
2025-08-14 23:49:19 +05:30
parent 5902300c95
commit 9474d2f633
3 changed files with 40 additions and 9 deletions

View File

@@ -40,15 +40,9 @@ COPY config.json /etc/cloudflared/config.json
# Copy the binary from builder
COPY --from=builder /app/monaco-backend /monaco-backend
# Add startup script
RUN echo '#!/bin/sh\n\
# Start the backend\n\
/monaco-backend & \n\
# Wait for backend to start\n\
sleep 5\n\
# Start cloudflared tunnel using config file\n\
cloudflared tunnel --no-autoupdate run --config /etc/cloudflared/config.json\n\
' > /start.sh && chmod +x /start.sh
# Copy the startup script
COPY start.sh /start.sh
RUN chmod +x /start.sh
# Expose port for local access
EXPOSE 8080