```yaml
version: '3.8'
services:
bot:
image: yourusername/habit-tracker-bot:latest
container_name: habit-tracker-bot
restart: unless-stopped
environment:
- TELEGRAM_TOKEN=your_telegram_bot_token
- DATABASE_URL=postgres://user:password@db:5432/habit_tracker
volumes:
- bot_data:/app/data
networks:
- habit-tracker-network
db:
image: postgres:latest
container_name: habit-tracker-db
restart: unless-stopped
environment:
- POSTGRES_USER=user
- POSTGRES_PASSWORD=password
- POSTGRES_DB=habit_tracker
volumes:
- db_data:/var/lib/postgresql/data
networks:
- habit-tracker-network
# Optional: Use this service for any background task handling (if needed)
worker:
image: yourusername/habit-tracker-worker:latest
container_name: habit-tracker-worker
restart: unless-stopped
environment:
- DATABASE_URL=postgres://user:password@db:5432/habit_tracker
networks:
- habit-tracker-network
networks:
habit-tracker-network:
driver: bridge
volumes:
bot_data:
db_data:
```
Please ensure to replace `yourusername/habit-tracker-bot:latest`, `your_telegram_bot_token`, and other placeholders with actual values specific to your deployment configuration.