mirror of
https://github.com/vmorganp/Lazytainer.git
synced 2025-12-24 06:28:08 +01:00
initial commit
This commit is contained in:
6
Dockerfile
Normal file
6
Dockerfile
Normal 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
22
docker-compose.yaml
Normal 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
8
get_stats.sh
Normal 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
|
||||||
Reference in New Issue
Block a user