forked from mtusi2026/mtusi2026lab4
лаба 4 на оценку 5
This commit is contained in:
+9
-1
@@ -9,7 +9,15 @@ cd "$project_root"
|
||||
env_file=${ENV_FILE:-.env}
|
||||
matched_container=
|
||||
|
||||
for container_id in $(docker compose --env-file "$env_file" ps -a -q api); do
|
||||
compose() {
|
||||
if [ -f "$env_file" ]; then
|
||||
docker compose --env-file "$env_file" "$@"
|
||||
else
|
||||
docker compose "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
for container_id in $(compose ps -a -q api); do
|
||||
instance_id=$(docker inspect --format '{{.Config.Hostname}}' "$container_id")
|
||||
if [ "$instance_id" = "$TARGET_INSTANCE_ID" ]; then
|
||||
if [ -n "$matched_container" ]; then
|
||||
|
||||
Reference in New Issue
Block a user