Recommended Deployment Method for LunaTV: Zeabur Cloud vs Docker Compose
The recommended deployment method for LunaTV uses containerized Docker architecture with a Kvrocks data store, deployable either through managed Zeabur hosting or self-hosted Docker Compose configuration.
LunaTV, developed by MoonTechLab, is engineered specifically for containerized environments. According to the project source code and documentation, the recommended deployment method for LunaTV requires running the official container image alongside a Kvrocks database instance to manage persistent storage and session state.
Why Docker Is the Foundation
The entire LunaTV application stack is built around Docker containers. The Dockerfile in the repository root defines the runtime environment, while docker-compose.dev.yml provides the orchestration template. This container-first approach ensures consistent behavior across development and production environments.
The application stores configuration and session data in Kvrocks, a Redis-compatible persistent storage engine. The client implementation in src/lib/kvrocks.db.ts handles all database interactions, making the storage layer swappable only between Kvrocks, Redis, or Upstash-compatible backends.
Option 1: One-Click Zeabur Deployment
Zeabur provides the fastest path to production. This managed platform automatically pulls the ghcr.io/moontechlab/lunatv:latest image, provisions a Kvrocks instance, and configures HTTPS termination, CDN distribution, and persistent volume storage.
To deploy via Zeabur, click the deployment badge in the repository's README.md. The platform handles environment variable injection and networking automatically, requiring no manual server configuration.
Option 2: Self-Hosted Docker Compose
For environments requiring full infrastructure control, the manual Docker Compose method provides complete customization. This approach uses the same official container image but allows you to manage the host system, networking, and storage volumes directly.
Required Environment Variables
Regardless of deployment method, LunaTV requires these environment variables:
- USERNAME: Administrative username for the LunaTV interface
- PASSWORD: Secure password for authentication
- NEXT_PUBLIC_STORAGE_TYPE: Must be set to
kvrocksfor the recommended configuration - KVROCKS_URL: Connection string formatted as
redis://hostname:port(e.g.,redis://moontv-kvrocks:6666)
Docker Compose Configuration
Create a docker-compose.yml file using this official configuration structure:
services:
moontv-core:
image: ghcr.io/moontechlab/lunatv:latest
container_name: moontv-core
restart: on-failure
ports:
- '3000:3000'
environment:
- USERNAME=admin
- PASSWORD=admin_password
- NEXT_PUBLIC_STORAGE_TYPE=kvrocks
- KVROCKS_URL=redis://moontv-kvrocks:6666
networks:
- moontv-network
depends_on:
- moontv-kvrocks
moontv-kvrocks:
image: apache/kvrocks
container_name: moontv-kvrocks
restart: unless-stopped
volumes:
- kvrocks-data:/var/lib/kvrocks
networks:
- moontv-network
networks:
moontv-network:
driver: bridge
volumes:
kvrocks-data:
This configuration mounts a persistent volume for Kvrocks data at /var/lib/kvrocks, ensuring data survives container restarts. The next.config.js file within the LunaTV image reads these environment variables at startup to establish the database connection defined in src/lib/kvrocks.db.ts.
Key Files in the Deployment Architecture
Understanding these source files helps troubleshoot deployment issues:
Dockerfile: Defines the Node.js runtime environment and build process for the production imagedocker-compose.dev.yml: Development-ready orchestration template that can be adapted for production usesrc/lib/kvrocks.db.ts: Contains the Kvrocks client implementation that manages connection pooling and query executionnext.config.js: Next.js configuration that processes environment variables at build and runtimeREADME.md: Contains the authoritative deployment instructions and environment variable documentation
Summary
- The recommended deployment method for LunaTV uses Docker containers with the official
ghcr.io/moontechlab/lunatv:latestimage - Kvrocks is the preferred storage backend, implemented in
src/lib/kvrocks.db.ts, though Redis-compatible alternatives work - Zeabur offers automated, managed deployment with HTTPS and CDN included
- Docker Compose provides self-hosted flexibility with full control over networking and persistence
- Required environment variables are
USERNAME,PASSWORD,NEXT_PUBLIC_STORAGE_TYPE, andKVROCKS_URL
Frequently Asked Questions
What is the recommended deployment method for LunaTV?
The recommended deployment method uses Docker containers with a Kvrocks data store. You can deploy via one-click Zeabur hosting for managed convenience, or use Docker Compose on your own infrastructure for full control. Both methods use the same official image and require identical environment variable configuration.
Can I use Redis instead of Kvrocks for LunaTV deployment?
Yes, LunaTV supports Redis and Upstash as alternative storage backends. However, the project documentation specifically recommends Kvrocks for production deployments due to its persistent storage capabilities and compatibility with the client implementation in src/lib/kvrocks.db.ts.
What environment variables are required to deploy LunaTV?
You must set four critical environment variables: USERNAME and PASSWORD for authentication, NEXT_PUBLIC_STORAGE_TYPE (set to kvrocks for the recommended setup), and KVROCKS_URL containing the connection string to your storage instance. These are processed by the application configuration in next.config.js at startup.
Is the official LunaTV Docker image suitable for production use?
Yes, the ghcr.io/moontechlab/lunatv:latest image is production-ready when configured with proper environment variables and persistent storage. The image includes optimizations defined in the repository's Dockerfile and is designed to restart gracefully on failure when using restart: on-failure in your Compose configuration.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →