smcclennon / SongID

Music identification Telegram bot
https://t.me/SongIDBot
Apache License 2.0
87 stars 20 forks source link

Add Docker support #11

Closed smcclennon closed 1 week ago

smcclennon commented 1 week ago

Summary by Sourcery

Add Docker support for the application by introducing a docker-compose.yml file. Refactor configuration management to utilize environment variables, enhancing security and flexibility. Remove Heroku-specific deployment logic in favor of a standard polling mechanism.

New Features:

Enhancements:

Deployment:

sourcery-ai[bot] commented 1 week ago

Reviewer's Guide by Sourcery

This PR adds Docker support to the application by restructuring the configuration management from JSON files to environment variables and implementing Docker containerization. The changes primarily focus on configuration handling and project structure modifications to support containerized deployment.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Migrated configuration management from JSON files to environment variables
  • Removed JSON configuration files (token.json and acrcloud.json)
  • Created environment variable structure for all configuration settings
  • Restructured ACR Cloud configuration to use environment variables
  • Updated Telegram bot configuration to use environment variables
  • Removed Heroku-specific configuration and webhook setup
app/ACRAPI.py
app/SongIDCore.py
Added Docker support with compose configuration
  • Created docker-compose.yml with service configuration
  • Set up environment variable mappings for Docker
  • Configured volume mapping for persistent data
  • Added Python unbuffered mode for real-time logging
docker-compose.yml
Restructured project organization
  • Moved Python files to app directory
  • Removed setup.py and Procfile
  • Simplified polling initialization by removing Heroku-specific code
app/SongID.py
setup.py
Procfile

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).