Refactor docker-compose.yml & Dockerfile; Add Dockerfile_Ngx_template

This commit is contained in:
2024-10-25 15:50:02 +03:00
parent 76aef119bd
commit e6d39be83f
5 changed files with 80 additions and 13 deletions

View File

@@ -1,14 +1,18 @@
FROM nginx:latest
# from custom image
FROM ngx-template:latest
ARG NET_NAME=kek
ARG CONTAINER_NAME=lol
ARG STATIC_FILE=/usr/share/nginx/html/index.html
COPY ./scripts/knocking_setup.sh /root/scripts/knocking_setup.sh
# change default nginx index.html
RUN sed -i '13,21d' $STATIC_FILE && \
sed -i "13i <table>\
<tr><th>NETWORK</th><th>CONTAINER</th></tr>\
<tr><td>$NET_NAME</td><td>$CONTAINER_NAME</td></tr>\
</table>" $STATIC_FILE
# commented lines don't work
CMD /root/scripts/knocking_setup.sh \
&& nginx && knockd -d && sleep infinity