Skip to content

Conversation

DANIELXXOMG2
Copy link

Summary

This PR significantly improves the Docker setup for TorBot with a multi-stage build approach, enhanced security, and comprehensive documentation.

Changes Made

Docker Optimization

  • Multi-stage Dockerfile: Implemented optimized build with separate builder and runtime stages
  • Security improvements: Added non-root user (torbot:torbot) for container execution
  • Size reduction: Using python:3.11.4-slim for runtime stage
  • Health checks: Added HEALTHCHECK instruction for container monitoring
  • Build optimization: Added .dockerignore to reduce build context

Docker Compose Support

  • docker-compose.yml: Created for easy development setup
  • docker-compose.test.yml: Added for testing with Tor proxy integration
  • Service dependencies: Configured tor-test service for integration testing

Documentation

  • docs/DOCKER.md: Comprehensive Docker usage documentation
  • Updated README.md: Added Docker instructions and features
  • Updated TESTING.md: Added Docker testing guidelines
  • Updated CHANGELOG.md: Documented all Docker-related changes
  • Updated Tor.md: Added Docker Tor configuration
  • CONTRIBUTING.md: New contribution guidelines

Dependencies & Security

  • Updated dependencies: Bumped versions to latest secure releases
  • Switch to pip: Replaced Poetry with pip for better compatibility
  • Security patches: Updated httpx to 0.28.1+ for security fixes

Testing Instructions

Local Development

docker-compose up --build

Testing

docker-compose -f docker-compose.test.yml up --build

Manual Build

docker build -t torbot .
docker run -p 9050:9050 torbot

Security Considerations

  • Non-root user execution
  • Minimal runtime image
  • Updated dependencies with security patches
  • Proper file permissions

Breaking Changes

None - all changes are backward compatible.

Checklist

  • Multi-stage Dockerfile implemented
  • Docker Compose configurations added
  • Documentation updated
  • Security improvements implemented
  • Testing setup configured
  • Dependencies updated
  • Contribution guidelines added

…documentation

- Implement multi-stage Dockerfile for smaller, more secure images
- Add .dockerignore to optimize build context
- Create docker-compose.yml for easy development setup
- Add docker-compose.test.yml for testing with Tor proxy
- Create comprehensive Docker documentation in docs/DOCKER.md
- Update README.md with new Docker usage instructions
- Update TESTING.md with Docker testing instructions
- Update CHANGELOG.md with Docker-related changes
- Update Tor.md with Docker Tor configuration
- Add CONTRIBUTING.md with contribution guidelines
- Update dependencies to latest secure versions
- Switch from Poetry to pip for better compatibility
- Add non-root user for security
- Include HEALTHCHECK in Dockerfile
@KingAkeem
Copy link
Member

This looks comprehensive, going to check it out.

@KingAkeem
Copy link
Member

I'm getting an error when starting the containers.

image

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