From 44a7450f5df5fb31110b832995779411bf965b87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johnny=20Miller=20=28=E9=94=BA=E4=BF=8A=29?= Date: Thu, 14 May 2020 14:13:57 +0800 Subject: [PATCH] build($Docker): use 20-bit block private network 172.16.1.0/24 Private network https://en.wikipedia.org/wiki/Private_network IP range of 172.16.1.0/24 https://ipgeolocation.io/browse/ipv4/172.16.1.0/24 BREAKING CHANGE: update network configuration in Docker compose --- docker-compose.development-docker.yml | 69 ++++++++++++++------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/docker-compose.development-docker.yml b/docker-compose.development-docker.yml index ff0b80dd..22377365 100644 --- a/docker-compose.development-docker.yml +++ b/docker-compose.development-docker.yml @@ -2,49 +2,51 @@ version: "3.7" services: mysql: - container_name: mysql-m&f-dev_dkr + container_name: mysql-mf-dev_dkr image: "mysql:latest" environment: MYSQL_ROOT_PASSWORD: "jm@mysql" ports: - "3306:3306" volumes: - - /Users/johnny/docker-file-mapping/mysql-m&f:/var/lib/mysql + - /Users/johnny/docker-file-mapping/mysql-mf:/var/lib/mysql command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci networks: - exrx_net_crawler_network: - ipv4_address: 172.16.238.1 + muscle_and_fitness_network: + ipv4_address: 172.16.1.10 redis: - container_name: redis-m&f-dev_dkr + container_name: redis-mf-dev_dkr image: redis:6.0.1 ports: - "6379:6379" restart: always volumes: - - /Users/johnny/docker-file-mapping/redis-m&f/data:/data - - /Users/johnny/docker-file-mapping/redis-m&f/redis.conf:/usr/local/etc/redis/redis.conf + - /Users/johnny/docker-file-mapping/redis-mf/data:/data + - /Users/johnny/docker-file-mapping/redis-mf/redis.conf:/usr/local/etc/redis/redis.conf command: "redis-server /usr/local/etc/redis/redis.conf" - ipv4_address: 172.16.238.2 + networks: + muscle_and_fitness_network: + ipv4_address: 172.16.1.11 atmoz-sftp: - container_name: atmoz-sftp-m&f-dev_dkr + container_name: atmoz-sftp-mf-dev_dkr image: atmoz/sftp:latest ports: - "23:22" restart: always volumes: - - /Users/johnny/docker-file-mapping/atmoz-sftp-m&f:/home/johnny/upload + - /Users/johnny/docker-file-mapping/atmoz-sftp-mf:/home/johnny/upload command: "johnny:atmoz@sftp:::upload" networks: - exrx_net_crawler_network: - ipv4_address: 172.16.238.3 + muscle_and_fitness_network: + ipv4_address: 172.16.1.12 open-zipkin: - container_name: open-zipkin + container_name: open-zipkin-mf image: openzipkin/zipkin # Environment settings are defined here https://github.com/openzipkin/zipkin/blob/master/zipkin-server/README.md#environment-variables - environment: + # environment: # - STORAGE_TYPE=mysql # Point the zipkin at the storage backend # - MYSQL_HOST=mysql @@ -60,8 +62,8 @@ services: # Uncomment if you set SCRIBE_ENABLED=true # - 9410:9410 networks: - exrx_net_crawler_network: - ipv4_address: 172.11.239.4 + muscle_and_fitness_network: + ipv4_address: 172.16.1.13 service-registry: container_name: service-registry-dev_dkr @@ -71,8 +73,8 @@ services: volumes: - /Users/johnny/docker-file-mapping/muscle-and-fitness-server:/logs-dev_dkr networks: - exrx_net_crawler_network: - ipv4_address: 172.11.239.5 + muscle_and_fitness_network: + ipv4_address: 172.16.1.14 spring-boot-admin: container_name: spring-boot-admin-dev_dkr @@ -82,8 +84,8 @@ services: volumes: - /Users/johnny/docker-file-mapping/muscle-and-fitness-server:/logs-dev_dkr networks: - exrx_net_crawler_network: - ipv4_address: 172.11.239.6 + muscle_and_fitness_network: + ipv4_address: 172.16.1.15 api-portal: container_name: api-portal-dev_dkr @@ -93,8 +95,8 @@ services: volumes: - /Users/johnny/docker-file-mapping/muscle-and-fitness-server:/logs-dev_dkr networks: - exrx_net_crawler_network: - ipv4_address: 172.11.239.7 + muscle_and_fitness_network: + ipv4_address: 172.16.1.16 auth-center: container_name: auth-center-dev_dkr @@ -104,8 +106,8 @@ services: volumes: - /Users/johnny/docker-file-mapping/muscle-and-fitness-server:/logs-dev_dkr networks: - exrx_net_crawler_network: - ipv4_address: 172.11.239.8 + muscle_and_fitness_network: + ipv4_address: 172.16.1.17 exercise-mis: container_name: exercise-mis-dev_dkr @@ -115,8 +117,8 @@ services: volumes: - /Users/johnny/docker-file-mapping/muscle-and-fitness-server:/logs-dev_dkr networks: - exrx_net_crawler_network: - ipv4_address: 172.11.239.9 + muscle_and_fitness_network: + ipv4_address: 172.16.1.18 muscle-mis: container_name: muscle-mis-dev_dkr @@ -126,8 +128,8 @@ services: volumes: - /Users/johnny/docker-file-mapping/muscle-mis:/logs-dev_dkr networks: - exrx_net_crawler_network: - ipv4_address: 172.11.239.10 + muscle_and_fitness_network: + ipv4_address: 172.16.1.19 gateway: container_name: gateway-dev_dkr @@ -137,12 +139,15 @@ services: volumes: - /Users/johnny/docker-file-mapping/muscle-and-fitness-server:/logs-dev_dkr networks: - exrx_net_crawler_network: - ipv4_address: 172.11.239.254 + muscle_and_fitness_network: + # Gateway uses the last IP of the subnet + ipv4_address: 172.16.1.255 networks: - exrx_net_crawler_network: + muscle_and_fitness_network: ipam: driver: default config: - - subnet: "172.11.239.0/24" + # Private Network (20-bit block): https://en.wikipedia.org/wiki/Private_network + # IP range of the private network: https://ipgeolocation.io/browse/ipv4/172.16.1.0/24 + - subnet: "172.16.1.0/24"