fititnt / chatops-wg-infra

ChatOps _for non-DevOps people_ Working Group 2018/01 - Infrastructure main repository
https://github.com/fititnt/chatops-wg
1 stars 0 forks source link

Review internal Traefik network (close some exposed ports; fix new Gateway Timeouts and put networking inside docker-compose.yml) #7

Closed fititnt closed 6 years ago

fititnt commented 6 years ago

Solution to issue #2 broke the routing. Old temporary way without docker-compose.yml forced me to use docker network connect ... a few times like:

https://github.com/fititnt/chatops-wg-infra/blob/0acee6a3aded594489b61f0ba1c63ac82d2fa360/logbook/chatopswg.sh#L98

This is the current state of networking:

# fititnt at bravo in /alligo/code/fititnt/chatops-wg-infra on git:master o [15:01:17]
$ ssh root@chatopswg.alligo.com.br
Last login: Sat Feb  3 16:49:02 2018 from 201.21.218.157
root@chatopswg:~# docker ps
CONTAINER ID        IMAGE                   COMMAND                  CREATED             STATUS              PORTS                                                              NAMES
bfb29eadf284        traefik                 "/traefik"               8 minutes ago       Up 7 minutes        0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:8080->8080/tcp   traefik_traefik_1
98e43c2837be        nginx:alpine            "/bin/sh -c 'nginx..."   12 days ago         Up 12 days          0.0.0.0:8100->80/tcp                                               placeholder_nginx_1
1c2175750b31        node:alpine             "npm start"              12 days ago         Up 12 days          0.0.0.0:3400->3000/tcp                                             iajsbotkit_nodejs_1
bcd79facbe0d        nanoninja/php-fpm:7.1   "docker-php-entryp..."   12 days ago         Up 12 days          9000/tcp, 0.0.0.0:3200->3000/tcp                                   iaphpbotman_php_1
a4fd36c3be3f        nginx:alpine            "/bin/sh -c 'nginx..."   12 days ago         Up 12 days          0.0.0.0:8200->80/tcp                                               iaphpbotman_nginx_1
c2dba79c9df5        rocket.chat:latest      "node main.js"           13 days ago         Up 2 days           0.0.0.0:3000->3000/tcp                                             rocketchat_rocketchat_1
7df3c7dc7ed8        mongo:3.2               "docker-entrypoint..."   13 days ago         Up 2 days           27017/tcp                                                          rocketchat_mongo_1

It works, but lets close a few doors binded directly to the host ports and force all the things via traefik.

fititnt commented 6 years ago

Now:

root@chatopswg:~/containers# docker ps
CONTAINER ID        IMAGE                   COMMAND                  CREATED             STATUS              PORTS                                                              NAMES
e2ded707228a        rocket.chat:latest      "node main.js"           10 minutes ago      Up 10 minutes       3000/tcp                                                           rocketchat_rocketchat_1
999ff8eeffeb        nginx:alpine            "/bin/sh -c 'nginx..."   13 minutes ago      Up 13 minutes       80/tcp                                                             placeholder_nginx_1
76d8b846bbf6        traefik                 "/traefik"               22 minutes ago      Up 20 seconds       0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:8080->8080/tcp   traefik_traefik_1
1c2175750b31        node:alpine             "npm start"              12 days ago         Up 17 minutes       0.0.0.0:3400->3000/tcp                                             iajsbotkit_nodejs_1
bcd79facbe0d        nanoninja/php-fpm:7.1   "docker-php-entryp..."   12 days ago         Up 17 minutes       9000/tcp, 0.0.0.0:3200->3000/tcp                                   iaphpbotman_php_1
a4fd36c3be3f        nginx:alpine            "/bin/sh -c 'nginx..."   12 days ago         Up 17 minutes       0.0.0.0:8200->80/tcp                                               iaphpbotman_nginx_1
7df3c7dc7ed8        mongo:3.2               "docker-entrypoint..."   13 days ago         Up 17 minutes       27017/tcp                                                          rocketchat_mongo_1

https://github.com/fititnt/chatops-wg-ia-js-botkit & https://github.com/fititnt/chatops-wg-ia-php-botman needs update to block ports. Later I commit it.