initial commit

This commit is contained in:
vmorganp
2021-10-12 21:01:31 -07:00
commit ba055329bd
3 changed files with 36 additions and 0 deletions

6
Dockerfile Normal file
View File

@@ -0,0 +1,6 @@
from alpine
RUN apk update && apk add --no-cache docker-cli
COPY ./get_stats.sh /get_stats.sh
CMD [ "/bin/sh", "/get_stats.sh" ]
# ENTRYPOINT ["tail", "-f", "/dev/null"]

22
docker-compose.yaml Normal file
View File

@@ -0,0 +1,22 @@
version: "3"
services:
whoami:
container_name: whoami
build: .
# image: sandman
environment:
- PORT=81
ports:
- 81:81
# command: tail -F asdf
command: /bin/sh /get_stats.sh
whoami2:
container_name: whoami2
image: containous/whoami
command: --port 81
network_mode: service:whoami
depends_on:
- whoami
# ports:
# - 80:80

8
get_stats.sh Normal file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
while [ 1 ];
do
echo "$(netstat -n | grep $PORT | wc -l) active connections on $PORT"
echo "tx packets: $(cat /sys/class/net/eth0/statistics/tx_packets)"
echo "rx packets: $(cat /sys/class/net/eth0/statistics/rx_packets)"
sleep 1;
done