Skip to content

Commit

Permalink
Merge pull request #1017 from YevhenZvieriev/feature/container-monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
markshust authored Feb 24, 2024
2 parents 0f1517e + 82ffbaf commit 2dfcd75
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ It is recommended to keep your root docker config files in one repository, and y
- `bin/download`: Download specific Magento version from Composer to the container, with optional arguments of the version (2.4.6-p3 [default]) and type ("community" [default], "enterprise", or "mageos"). Ex. `bin/download 2.4.6-p3 enterprise`
- `bin/debug-cli`: Enable Xdebug for bin/magento, with an optional argument of the IDE key. Defaults to PHPSTORM Ex. `bin/debug-cli enable PHPSTORM`
- `bin/deploy`: Runs the standard Magento deployment process commands. Pass extra locales besides `en_US` via an optional argument. Ex. `bin/deploy nl_NL`
- `bin/docker-stats`: Display status for CPU, memory usage, and memory limit of currently-running Docker containers.
- `bin/fixowns`: This will fix filesystem ownerships within the container.
- `bin/fixperms`: This will fix filesystem permissions within the container.
- `bin/grunt`: Run the grunt binary. Ex. `bin/grunt exec`
Expand Down
1 change: 1 addition & 0 deletions compose/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ help:
@echo "$(call format,dev-urn-catalog-generate,'Generate URNs for PHPStorm and remap paths to local host.')"
@echo "$(call format,devconsole,'Alias for n98-magerun2 dev:console.')"
@echo "$(call format,devtools-cli-check,'Check & install the CLI devtools if missing from system.')"
@echo "$(call format,docker-stats,'Display status for CPU, memory usage, and memory limit of currently-running Docker containers.')"
@echo "$(call format,download,'Download & extract specific Magento version to the src directory.')"
@echo "$(call format,fixowns,'This will fix filesystem ownerships within the container.')"
@echo "$(call format,fixperms,'This will fix filesystem permissions within the container.')"
Expand Down
10 changes: 10 additions & 0 deletions compose/bin/docker-stats
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

container_ids=$(bin/docker-compose ps -q)

if [ -z "$container_ids" ]; then
echo "No active containers found"
exit 1
fi

docker stats "$container_ids"

0 comments on commit 2dfcd75

Please sign in to comment.