Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Sep 2, 2025

This PR implements comprehensive Docker support for the telegram-ssh project, addressing the request for containerized deployment instead of executable files.

What's Changed

🐳 Docker Implementation

  • Dockerfile: Optimized multi-stage build using Node.js Alpine base image with security best practices
  • Docker Compose: Ready-to-use configuration with volume mounts for SSH keys and persistent data
  • Environment Variables: Added support for all configuration options via environment variables as alternatives to CLI arguments

🔧 Configuration Enhancements

  • Backward Compatibility: Existing CLI usage remains unchanged
  • Flexible Configuration: Support for both command-line arguments and environment variables
  • Security: Non-root container user, read-only key mounts, proper file permissions

📚 Documentation & Examples

  • Comprehensive README: Updated with Docker setup instructions alongside Node.js setup
  • Example Files: .env.example and docker-compose.example.yml for quick setup
  • Troubleshooting Guide: Common issues and solutions for both Docker and general usage
  • Configuration Reference: Complete table of CLI arguments vs environment variables

🚀 Quick Start Example

# Copy example configurations
cp .env.example .env
cp docker-compose.example.yml docker-compose.yml

# Edit .env with your credentials
# Place SSH key in ./keys/id_rsa
# Launch with Docker Compose
docker compose up -d

🔒 Security Features

  • Alpine Linux base for minimal attack surface
  • Non-privileged container user
  • Read-only SSH key volume mounts
  • Isolated container environment

Environment Variables Support

CLI Argument Environment Variable Description
--bot_token BOT_TOKEN Telegram bot token
--chat_id CHAT_ID Telegram chat ID
--owner_ids OWNER_IDS Comma-separated owner chat IDs
--path_privatekey PATH_PRIVATEKEY Path to SSH private key
--servers_file SERVERS_FILE Path to servers JSON file

This implementation makes deployment significantly easier while maintaining all existing functionality and adding modern containerization benefits.

Fixes #2.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link
Author

Copilot AI commented Sep 2, 2025

@phamthainb 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Copilot AI and others added 2 commits September 2, 2025 06:56
Co-authored-by: phamthainb <55950535+phamthainb@users.noreply.github.com>
…bleshooting

Co-authored-by: phamthainb <55950535+phamthainb@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Instead of an executable file, I think it would be better to implement a launch via docker Add Docker support as alternative to executable deployment Sep 2, 2025
@Copilot Copilot AI requested a review from phamthainb September 2, 2025 07:00
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.

Instead of an executable file, I think it would be better to implement a launch via docker

2 participants