commit 65afb203f1a2df1be621d4bbd0dc87e7bfe1b8e6 Author: Nick Date: Fri Oct 18 01:07:46 2024 +0300 1&2 stage worked diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0601f74 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM nginx:latest + +ARG NET_NAME=kek +ARG CONTAINER_NAME=lol +ARG STATIC_FILE=/usr/share/nginx/html/index.html + + +RUN sed -i '13,21d' $STATIC_FILE && \ + sed -i "13i

$NET_NAME
$CONTAINER_NAME

" $STATIC_FILE + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8c50630 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,58 @@ +version: "3" + +services: +# ---------------------------------------------- + ngx1-net1: + build: + context: . + args: + NET_NAME: net_1 + CONTAINER_NAME: container_1 + ports: + - "8080:80" + networks: + - net_1 + - net_3 + ngx2-net1: + build: + context: . + args: + NET_NAME: net_1 + CONTAINER_NAME: container_2 + networks: + - net_1 +# ---------------------------------------------- + ngx1-net2: + build: + context: . + args: + NET_NAME: net_2 + CONTAINER_NAME: container_1 + ports: + - "8081:80" + networks: + - net_2 + - net_3 + ngx2-net2: + build: + context: . + args: + NET_NAME: net_2 + CONTAINER_NAME: container_2 + networks: + - net_2 +# ---------------------------------------------- + visor: + image: ubuntu:latest + restart: on-failure + command: > + bash -c "apt update + && apt install iproute2 vim curl nmap -y + && sleep infinity" + networks: + - net_3 + +networks: + net_1: + net_2: + net_3: