Skip to content

Conversation

@mverteuil
Copy link
Owner

Summary

This PR adds automated Docker image publishing for releases and standardizes variable naming to use the BIRDNETPI_* prefix consistently.

Changes

🚀 Docker Release Automation

  • New workflow: .github/workflows/docker-release.yml
    • Triggers on tags starting with v (e.g., v2.0.0, v2.1.0-alpha)
    • Publishes to ghcr.io/mverteuil/birdnet-pi
    • Multi-platform support: linux/amd64 and linux/arm64
    • Semantic versioning tags: full version, major.minor, major, and latest
    • Separate init container images with -init suffix

📦 Production Docker Compose

  • New file: docker-compose.production.yml
    • Uses pre-built images from GitHub Container Registry
    • Supports Docker volumes and bind mounts (Home Assistant compatible)
    • Simplified configuration for end users

🏷️ Variable Naming Standardization

Renamed environment variables and volumes to use BIRDNETPI_* prefix:

  • BIRDNET_DATA_VOLUMEBIRDNETPI_DATA_VOLUME
  • birdnet-databirdnetpi-data (production volume)
  • birdnet-test-databirdnetpi-test-data (test volume)

Rationale: BIRDNETPI is the project name; BIRDNET is the underlying analysis tool.

Files updated:

  • docker-compose.yml
  • .github/workflows/ci.yml
  • tests/e2e/conftest.py

🔧 Init Container

Confirmed the init container is required for production deployments:

  • Downloads assets (~99MB: models, IOC database, Wikidata database)
  • Sets up proper file permissions
  • Initializes configuration from template
  • Works with both Docker volumes and bind mounts

Testing

  • ✅ All expensive tests passing (8/8)
  • ✅ Docker build verified
  • ✅ E2E tests with new variable names
  • ✅ Pre-commit hooks passing

Deployment Impact

For existing users: No breaking changes to development workflow. The variable name changes only affect:

  1. E2E test runs (which use test volumes)
  2. Production deployments using the new production compose file

For new deployments: Users can now pull pre-built images from GHCR instead of building locally.

## Changes

### GitHub Actions Workflow
- Add docker-release.yml workflow triggered by v* tags
- Builds multi-platform images (amd64/arm64) for GHCR
- Semantic versioning: generates tags for full version, major.minor, major, and latest
- Separate init container images tagged with -init suffix

### Variable Naming Standardization
- Rename BIRDNET_DATA_VOLUME → BIRDNETPI_DATA_VOLUME
- Rename birdnet-data → birdnetpi-data (production volume)
- Rename birdnet-test-data → birdnetpi-test-data (test volume)
- Update all references across docker-compose, CI workflows, and tests
- Rationale: BIRDNETPI is the project name, BIRDNET is the underlying tool

### Production Docker Compose
- Add docker-compose.production.yml for using published images
- Supports both Docker volumes and bind mounts (Home Assistant compatible)
- Simplified configuration for production deployments

### Init Container
- Confirmed init container is required for production deployments
- Handles asset downloads (~99MB), permissions, and config initialization
- Works seamlessly with both volume types

### Testing
- Update E2E test configuration for new variable names
- All expensive tests passing (8/8)
- Docker build and deployment verified
- Quote variables to prevent globbing and word splitting
- Use command grouping for multiple redirects to same file
- Addresses actionlint/shellcheck warnings:
  - SC2086: Quote variables
  - SC2129: Use { cmd1; cmd2; } >> file pattern
@mverteuil mverteuil force-pushed the feature/docker-releases branch from 9c382ee to 8cf31e7 Compare October 23, 2025 19:55
@mverteuil mverteuil merged commit c00f41c into main Oct 23, 2025
3 checks passed
@mverteuil mverteuil deleted the feature/docker-releases branch October 23, 2025 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants