Docker Compose Profiles¶
This document describes the Docker Compose profiles available for the DSTA project. Profiles allow you to selectively start services based on your needs.
Available Profiles¶
1. Minimal Profile¶
Purpose: Bare minimum services for API-only development.
Services Included: - postgres - PostgreSQL database - redis - Redis cache - api-server - Django API server
Usage:
Use Cases: - Quick API testing - Database migrations - Minimal resource usage - CI/CD pipelines
2. Development Profile (dev)¶
Purpose: Full development environment with debugging tools.
Services Included: - All services from minimal profile - bot-listener - Telegram bot listener - bot-notifier - Telegram bot notifier - dsta-sync-login-debug - Login refresher with debugging support
Usage:
Use Cases: - Active development - Bot testing - Debugging with IDE integration - Local testing of full system
3. Full Profile¶
Purpose: Complete production-like environment with all services.
Services Included: - All services from minimal profile - bot-listener - Telegram bot listener - bot-notifier - Telegram bot notifier - dsta-sync-login - Login refresher (production mode) - dsta-sync-schedule - Snapshot worker - dsta-manage-acc - Account management (one-time) - dsta-manage-url - URL management (one-time)
Usage:
Use Cases: - Production deployment - Staging environment - Full system testing - Performance testing
4. Testing Profile¶
Purpose: Minimal services for running automated tests.
Services Included: - postgres - PostgreSQL database (test database) - redis - Redis cache - api-server - Django API server
Usage:
Use Cases: - Automated testing - CI/CD test execution - Integration testing - Quick test runs
Profile Comparison¶
| Service | Minimal | Dev | Full | Testing |
|---|---|---|---|---|
| postgres | ✓ | ✓ | ✓ | ✓ |
| redis | ✓ | ✓ | ✓ | ✓ |
| api-server | ✓ | ✓ | ✓ | ✓ |
| bot-listener | ✗ | ✓ | ✓ | ✗ |
| bot-notifier | ✗ | ✓ | ✓ | ✗ |
| dsta-sync-login | ✗ | ✗ | ✓ | ✗ |
| dsta-sync-login-debug | ✗ | ✓ | ✗ | ✗ |
| dsta-sync-schedule | ✗ | ✗ | ✓ | ✗ |
| dsta-manage-acc | ✗ | ✗ | ✓ | ✗ |
| dsta-manage-url | ✗ | ✗ | ✓ | ✗ |
Common Commands¶
Start a specific profile:¶
docker-compose --profile minimal up
docker-compose --profile dev up
docker-compose --profile full up
docker-compose --profile testing up
Start with detached mode:¶
Stop all services:¶
View logs for a specific service:¶
Rebuild images:¶
Start specific services only:¶
Environment Variables¶
Profiles can be combined with environment variables:
# Use development profile with custom API port
API_SERVER_PORT=8080 docker-compose --profile dev up
# Use full profile with production environment
PROFILE=prod docker-compose --profile full up
Best Practices¶
- Development: Use
devprofile for daily development work - Quick Tests: Use
minimalprofile for quick API tests - CI/CD: Use
testingprofile in automated pipelines - Staging/Production: Use
fullprofile for deployment - Resource Management: Use minimal profiles when running on constrained systems
Troubleshooting¶
Services not starting?¶
Check that you're using the correct profile:
Need multiple profiles?¶
Docker Compose supports multiple profiles:
Reset everything:¶
Custom Profiles¶
You can create custom profiles by modifying docker-compose.yaml:
Then use:
Related Documentation¶
Last Updated: 2025-11-24