Does TrendRadar Have a Dockerfile? A Complete Guide to Containerized Deployment
Yes, TrendRadar ships with a production-ready Dockerfile located at docker/Dockerfile that builds a slim Python 3.12 image with multi-architecture support for both amd64 and arm64.
TrendRadar, an open-source trend analysis tool maintained by sansan0, provides comprehensive Docker support for containerized deployment. Whether you're running on traditional x86 servers, Apple Silicon, or ARM-based cloud instances, the TrendRadar Dockerfile enables consistent, reproducible deployments across any platform.
What Is the TrendRadar Dockerfile?
The TrendRadar Dockerfile is a production-grade container definition that packages the entire application into a portable, runnable image. Located at docker/Dockerfile in the repository, it implements modern container best practices including multi-stage builds, dependency caching, and cross-platform compatibility.
Base Image and Architecture
The Dockerfile uses python:3.12-slim-bookworm as its foundation, providing a minimal attack surface while maintaining full compatibility with TrendRadar's Python requirements. For multi-architecture support, the build automatically detects the target platform through the TARGETARCH build argument and downloads the appropriate supercronic binary—either amd64 or arm64.
Dependency Management with uv
Rather than traditional pip installs, the TrendRadar Dockerfile leverages uv for lightning-fast, deterministic dependency resolution. The build process:
- Copies
pyproject.tomlanduv.lockinto the image - Runs
uv syncto install locked dependencies (cached layer) - Copies source code only after dependencies are resolved
This layer ordering maximizes build cache efficiency—code changes don't trigger full dependency reinstalls.
Source Code and Entry Point
The Dockerfile copies two critical components:
docker/manage.py— the scheduler launcher placed at the image roottrendradar/— the main application source code
The entrypoint.sh script (converted to LF line endings for cross-platform compatibility) serves as the container's execution gateway, ultimately invoking manage.py to start the TrendRadar scheduler.
Building the TrendRadar Docker Image
Basic Build (Host Architecture)
For most deployments, simply build against your current platform:
docker build -t trendradar:latest -f docker/Dockerfile .
This produces an image tagged trendradar:latest optimized for your local architecture.
Cross-Platform Build (Explicit Architecture)
To target a specific platform—essential for Apple Silicon Macs deploying to x86 servers or ARM cloud instances:
# Build for ARM64 (Apple Silicon, AWS Graviton, etc.)
docker build --build-arg TARGETARCH=arm64 -t trendradar:arm64 -f docker/Dockerfile .
# Build for AMD64 (traditional x86_64 servers)
docker build --build-arg TARGETARCH=amd64 -t trendradar:amd64 -f docker/Dockerfile .
The TARGETARCH argument propagates through the build, ensuring the correct supercronic binary is downloaded and installed.
Running TrendRadar in Docker
Quick Start with Docker Run
Deploy a TrendRadar container with minimal configuration:
docker run --rm \
-v "$(pwd)/config:/app/config:ro" \
-v "$(pwd)/output:/app/output" \
-e CONFIG_PATH=/app/config/config.yaml \
-e FREQUENCY_WORDS_PATH=/app/config/frequency_words.txt \
trendradar:latest
Key mount points:
/app/config— read-only configuration directory containingconfig.yamlandfrequency_words.txt/app/output— writable directory for generated reports and data
Environment variables:
CONFIG_PATH— absolute path to main configuration fileFREQUENCY_WORDS_PATH— absolute path to frequency word list
Docker Compose Deployment
For production or development environments, use the provided docker-compose.yml:
docker compose -f docker/docker-compose.yml up --build
This orchestrates:
- Image build with cache optimization
- Volume mounts for
config/andoutput/ - Environment variable injection
- Foreground process management for log visibility
Additional Dockerfiles in TrendRadar
Beyond the main application, TrendRadar provides specialized container definitions:
| File | Purpose |
|---|---|
docker/Dockerfile |
Primary application container (Python 3.12, scheduler) |
docker/Dockerfile.mcp |
MCP (Model Context Protocol) server component for AI integrations |
The Dockerfile.mcp enables TrendRadar's optional AI assistant capabilities, packaging the MCP server as a separate, independently scalable service.
Summary
- Yes, TrendRadar has a Dockerfile at
docker/Dockerfilewith production-ready containerization - Multi-architecture support for amd64 and arm64 via
TARGETARCHbuild argument - Modern Python tooling using
uvfor fast, reproducible dependency resolution - Optimized layer caching with
pyproject.toml/uv.lockcopied before source code - Flexible deployment options via
docker build,docker run, ordocker-compose - Additional specialized images including
Dockerfile.mcpfor AI integrations
Frequently Asked Questions
Where is the TrendRadar Dockerfile located?
The main TrendRadar Dockerfile is located at docker/Dockerfile in the repository root. A secondary Dockerfile for the MCP server component exists at docker/Dockerfile.mcp.
Does TrendRadar support ARM64/Apple Silicon?
Yes. The Dockerfile uses the TARGETARCH build argument to automatically select the correct supercronic binary for either amd64 or arm64. Build explicitly with --build-arg TARGETARCH=arm64 for Apple Silicon or ARM servers.
What base image does TrendRadar use?
The Dockerfile uses python:3.12-slim-bookworm as its base image, providing a minimal, secure foundation with Python 3.12 on Debian Bookworm.
How does TrendRadar handle dependencies in Docker?
Dependencies are managed with uv rather than pip. The Dockerfile copies pyproject.toml and uv.lock before the source code, enabling efficient layer caching where dependency installation only re-runs when lock files change.
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 →