Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add container monitoring script #1017

Merged
merged 6 commits into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,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"
Loading