A beautiful, colorized command-line tool for quickly viewing the status of all services in your Docker Compose setup at a glance.
- π¨ Colorful Output: Intuitive color-coded status indicators
- π Fast: Quick overview without scrolling through verbose Docker output
- π Smart Detection: Automatically finds and parses your compose file
- π₯οΈ Cross-Platform: Works on Linux, macOS, and Windows
- π¦ Simple: Single Python script, easy to install and use
- Python 3.7 or higher
- Docker and Docker Compose installed
- A
compose.yamlordocker-compose.yamlfile
-
Clone this repository:
git clone https://github.com/cdhouch/compose-status.git cd compose-status -
Install dependencies:
pip install -r requirements.txt
-
Make the script executable (Linux/macOS):
chmod +x compose-status.py
-
(Optional) Add to your PATH for global access:
# Add to ~/.bashrc or ~/.zshrc export PATH="$PATH:/path/to/compose-status"
Simply run the script:
./compose-status.pyThe script will automatically look for ~/compose.yaml (or ~/docker-compose.yaml).
You can specify a custom compose file location in three ways (in priority order):
-
Command-line argument (recommended):
./compose-status.py --file /path/to/your/compose.yaml # or using the short form: ./compose-status.py -f ./docker-compose.yml -
Environment variable:
export COMPOSE_FILE=/path/to/your/compose.yaml ./compose-status.pyOr specify it inline:
COMPOSE_FILE=/path/to/your/compose.yaml ./compose-status.py
-
Default location:
~/compose.yaml
View all available options:
./compose-status.py --helpDocker Compose Status (from /home/user/compose.yaml)
ββββββββββββββββββββββββββββββββββββββββββββ
audiobookshelf π’ running
calibre-web π’ running
ddns-updater π’ running
nginx-proxy-manager π’ running
qbittorrentvpn π’ running
ββββββββββββββββββββββββββββββββββββββββββββ
Tip: Run 'cd /home/user && docker compose ps -a' for full details.
| Icon | Color | Status | Meaning |
|---|---|---|---|
| π’ | Green | running |
Service is active and healthy |
| π΄ | Red | stopped |
Service is not running (exited/dead/stopped) |
| π¦ | Cyan | created |
Container exists but hasn't been started |
| βͺ | Yellow | not created |
Container doesn't exist in Docker |
| π‘ | Yellow | * |
Unknown or uncommon state |
- Locates Compose File: Checks in priority order:
- Command-line
--fileargument COMPOSE_FILEenvironment variable- Default:
~/compose.yaml
- Command-line
- Extracts Services: Parses the YAML file to find all service names
- Queries Docker: Runs
docker compose ps -ato get current service states - Displays Status: Shows a formatted, colorized report of all services
pyyaml>=6.0- For parsing Docker Compose YAML filesrich>=13.0- For beautiful terminal output and colors
Install with:
pip install pyyaml richMake sure Docker and Docker Compose are installed and in your PATH:
docker --version
docker compose versionThe script looks for ~/compose.yaml by default. Either:
- Create a compose file at that location, or
- Set the
COMPOSE_FILEenvironment variable to point to your compose file
This means Docker doesn't have containers for those services. Try:
cd ~ && docker compose up -dThe script uses the rich library which automatically detects terminal capabilities. If colors aren't showing:
- Make sure you're running in a terminal (not redirected output)
- Check that your terminal supports ANSI colors
- Try setting
TERM=xterm-256colorif needed
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes: Follow the existing code style and add comments
- Test your changes: Make sure the script still works correctly
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request: Describe your changes and why they're useful
- Clone the repository
- Install dependencies:
pip install -r requirements.txt - Make changes and test locally
- Ensure code is well-commented for maintainability
- Follow PEP 8 Python style guidelines
- Add docstrings to all functions
- Include inline comments for complex logic
- Keep functions focused and single-purpose
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by the need for a quick, visual way to check Docker Compose service status
- Built with Rich for beautiful terminal output
- Uses PyYAML for safe YAML parsing
Potential future enhancements:
- Support for multiple compose files
- JSON output mode for scripting
- Filter services by status
- Show resource usage (CPU, memory)
- Auto-refresh mode
- Integration with Docker Compose V2 profiles
If you encounter any issues or have questions:
- Check the Troubleshooting section
- Search existing Issues
- Open a new issue with details about your problem
Made with β€οΈ for the Docker community