forked from mtusi2026/mtusi2026lab3
34 lines
2.4 KiB
Plaintext
34 lines
2.4 KiB
Plaintext
$ docker inspect -f "{{.Name}} cpus={{.HostConfig.NanoCpus}} memory={{.HostConfig.Memory}} restart={{.HostConfig.RestartPolicy.Name}} ports={{json .HostConfig.PortBindings}}" $(docker compose ps -aq)
|
|
/messenger-lab3-api-1 cpus=1000000000 memory=536870912 restart=unless-stopped ports={}
|
|
/messenger-lab3-api-2 cpus=1000000000 memory=536870912 restart=unless-stopped ports={}
|
|
/messenger-lab3-api-short-ttl-1 cpus=1000000000 memory=536870912 restart=unless-stopped ports={}
|
|
/messenger-lab3-migrate-1 cpus=500000000 memory=268435456 restart=no ports={}
|
|
/messenger-lab3-nginx-1 cpus=500000000 memory=67108864 restart=unless-stopped ports={"8080/tcp":[{"HostIp":"127.0.0.1","HostPort":"8080"}],"8081/tcp":[{"HostIp":"127.0.0.1","HostPort":"8081"}]}
|
|
/messenger-lab3-postgres-1 cpus=1500000000 memory=536870912 restart=unless-stopped ports={}
|
|
/messenger-lab3-valkey-1 cpus=250000000 memory=100663296 restart=unless-stopped ports={}
|
|
$ for n in messenger-lab3_edge messenger-lab3_backend; do docker network inspect -f "{{.Name}} internal={{.Internal}} containers={{range .Containers}}{{.Name}} {{end}}" $n; done
|
|
messenger-lab3_edge internal=false containers=messenger-lab3-api-2 messenger-lab3-api-1 messenger-lab3-nginx-1
|
|
messenger-lab3_backend internal=true containers=messenger-lab3-api-2 messenger-lab3-valkey-1 messenger-lab3-postgres-1 messenger-lab3-api-1
|
|
$ grep -n "container_name" compose.yaml || echo "container_name: not used"
|
|
container_name: not used
|
|
$ docker compose config | grep -E "^\s+(published|target):" | sort | uniq -c
|
|
1 published: "8080"
|
|
1 published: "8081"
|
|
1 target: /etc/nginx/errors.conf
|
|
1 target: /etc/nginx/nginx.conf
|
|
1 target: /var/lib/postgresql
|
|
1 target: 8080
|
|
1 target: 8081
|
|
$ docker compose exec -T nginx sh -c "wget -q -O - --timeout 2 http://postgres:5432 2>&1 | head -1; nslookup postgres 127.0.0.11 2>&1 | tail -2"
|
|
wget: bad address 'postgres:5432'
|
|
** server can't find postgres: NXDOMAIN
|
|
|
|
$ curl -s --max-time 2 http://localhost:5432 >/dev/null 2>&1 && echo "5432 open" || echo "host 127.0.0.1:5432: closed"
|
|
host 127.0.0.1:5432: closed
|
|
$ docker stats --no-stream --format "{{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}" $(docker compose ps -q)
|
|
messenger-lab3-api-1 0.25% 45.73MiB / 512MiB
|
|
messenger-lab3-api-2 0.21% 45.42MiB / 512MiB
|
|
messenger-lab3-nginx-1 0.03% 2.59MiB / 64MiB
|
|
messenger-lab3-postgres-1 1.15% 30.5MiB / 512MiB
|
|
messenger-lab3-valkey-1 0.22% 11.04MiB / 96MiB
|