Skip to content

Commit

Permalink
build($Docker): update docker-compose
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
Johnny Miller (锺俊) committed Dec 28, 2020
1 parent c0b00f3 commit 7359519
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 179 deletions.
53 changes: 9 additions & 44 deletions docker/docker-compose.development-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,13 @@ version: "3.7"
# In Kubernetes, 'container_name' must not be set. #
# 2. ${TAG} is defined in file '.env'. #
# 3. The differences between each environment docker-compose.yml: #
# a. Environmental suffix. There are 4 types of environmental suffix: #
# * '-dev_dkr' #
# * '-test' #
# * '-stage' #
# * '-prod' #
# b. 'subnet' and 'ipv4_address'. #
# 4. IP range definition (for instance of 'development-docker'): #
# a. 172.16.1.10 ~ 172.16.1.19: middleware of Muscle and Fitness #
# b. 172.16.1.19 ~ 172.16.1.253: microservice of Muscle and Fitness #
# c. 172.16.1.254: gateway for Muscle and Fitness #
# CAUTION: 172.16.1.255 is not available for container. #
# 5. Conceal some service ports: #
# a. api-portal #
# b. auth-center #
# c. exercise-mis #
# d. muscle-mis #
# 6. Define timezone for environment variable: Asia/Hong_Kong #
# 7. Define 'depends_on' for service #
# Environmental suffix. There are 4 types of environmental suffix: #
# * '.dev' #
# * '.test' #
# * '.stage' #
# * '.prod' #
# 4. Define timezone for environment variable: Asia/Hong_Kong #
# 5. Define 'depends_on' for service #
################################################################################

services:
Expand Down Expand Up @@ -183,9 +172,9 @@ services:
networks:
muscle_and_fitness_network:

api-portal:
api-gateway:
container_name: maf.api-portal.dev
image: "ijohnnymiller/muscle-and-fitness-server.api-portal:${TAG}"
image: "ijohnnymiller/muscle-and-fitness-server.api-gateway:${TAG}"
depends_on:
mysql:
condition: service_started
Expand Down Expand Up @@ -260,34 +249,10 @@ services:
networks:
muscle_and_fitness_network:

################################################################################
# Gateway for Muscle and Fitness #
################################################################################
gateway:
container_name: maf.gateway.dev
image: "ijohnnymiller/muscle-and-fitness-server.gateway:${TAG}"
depends_on:
service-registry:
condition: service_started
ports:
- "8080:8080"
restart: always
volumes:
- ~/docker-file-mapping/maf.logs:/logs
environment:
JAVA_TOOL_OPTIONS: -Xms128m -Xmx128m -Dspring.profiles.active=development-docker
TZ: Asia/Hong_Kong
networks:
muscle_and_fitness_network:

################################################################################
# Network for Muscle and Fitness #
################################################################################
networks:
muscle_and_fitness_network:
ipam:
driver: default
# config:
# 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"
55 changes: 10 additions & 45 deletions docker/docker-compose.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,13 @@ version: "3.7"
# In Kubernetes, 'container_name' must not be set. #
# 2. ${TAG} is defined in file '.env'. #
# 3. The differences between each environment docker-compose.yml: #
# a. Environmental suffix. There are 4 types of environmental suffix: #
# * '-dev_dkr' #
# * '-test' #
# * '-stage' #
# * '-prod' #
# b. 'subnet' and 'ipv4_address'. #
# 4. IP range definition (for instance of 'development-docker'): #
# a. 172.16.1.10 ~ 172.16.1.19: middleware of Muscle and Fitness #
# b. 172.16.1.19 ~ 172.16.1.253: microservice of Muscle and Fitness #
# c. 172.16.1.254: gateway for Muscle and Fitness #
# CAUTION: 172.16.1.255 is not available for container. #
# 5. Conceal some service ports: #
# a. api-portal #
# b. auth-center #
# c. exercise-mis #
# d. muscle-mis #
# 6. Define timezone for environment variable: Asia/Hong_Kong #
# 7. Define 'depends_on' for service #
# Environmental suffix. There are 4 types of environmental suffix: #
# * '.dev' #
# * '.test' #
# * '.stage' #
# * '.prod' #
# 4. Define timezone for environment variable: Asia/Hong_Kong #
# 5. Define 'depends_on' for service #
################################################################################

services:
Expand Down Expand Up @@ -181,9 +170,9 @@ services:
networks:
muscle_and_fitness_network:

api-portal:
container_name: maf.api-portal.production
image: "ijohnnymiller/muscle-and-fitness-server.api-portal:${TAG}"
api-gateway:
container_name: maf.api-gateway.production
image: "ijohnnymiller/muscle-and-fitness-server.api-gateway:${TAG}"
depends_on:
mysql:
condition: service_started
Expand Down Expand Up @@ -258,34 +247,10 @@ services:
networks:
muscle_and_fitness_network:

################################################################################
# Gateway for Muscle and Fitness #
################################################################################
gateway:
container_name: maf.gateway.production
image: "ijohnnymiller/muscle-and-fitness-server.gateway:${TAG}"
depends_on:
service-registry:
condition: service_started
ports:
- "8080:8080"
restart: always
volumes:
- ~/docker-file-mapping/maf.logs:/logs
environment:
JAVA_TOOL_OPTIONS: -Xms128m -Xmx128m -Dspring.profiles.active=production
TZ: Asia/Hong_Kong
networks:
muscle_and_fitness_network:

################################################################################
# Network for Muscle and Fitness #
################################################################################
networks:
muscle_and_fitness_network:
ipam:
driver: default
# config:
# 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"
55 changes: 10 additions & 45 deletions docker/docker-compose.stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,13 @@ version: "3.7"
# In Kubernetes, 'container_name' must not be set. #
# 2. ${TAG} is defined in file '.env'. #
# 3. The differences between each environment docker-compose.yml: #
# a. Environmental suffix. There are 4 types of environmental suffix: #
# * '-dev_dkr' #
# * '-test' #
# * '-stage' #
# * '-prod' #
# b. 'subnet' and 'ipv4_address'. #
# 4. IP range definition (for instance of 'development-docker'): #
# a. 172.16.1.10 ~ 172.16.1.19: middleware of Muscle and Fitness #
# b. 172.16.1.19 ~ 172.16.1.253: microservice of Muscle and Fitness #
# c. 172.16.1.254: gateway for Muscle and Fitness #
# CAUTION: 172.16.1.255 is not available for container. #
# 5. Conceal some service ports: #
# a. api-portal #
# b. auth-center #
# c. exercise-mis #
# d. muscle-mis #
# 6. Define timezone for environment variable: Asia/Hong_Kong #
# 7. Define 'depends_on' for service #
# Environmental suffix. There are 4 types of environmental suffix: #
# * '.dev' #
# * '.test' #
# * '.stage' #
# * '.prod' #
# 4. Define timezone for environment variable: Asia/Hong_Kong #
# 5. Define 'depends_on' for service #
################################################################################

services:
Expand Down Expand Up @@ -181,9 +170,9 @@ services:
networks:
muscle_and_fitness_network:

api-portal:
container_name: maf.api-portal.stage
image: "ijohnnymiller/muscle-and-fitness-server.api-portal:${TAG}"
api-gateway:
container_name: maf.api-gateway.stage
image: "ijohnnymiller/muscle-and-fitness-server.api-gateway:${TAG}"
depends_on:
mysql:
condition: service_started
Expand Down Expand Up @@ -258,34 +247,10 @@ services:
networks:
muscle_and_fitness_network:

################################################################################
# Gateway for Muscle and Fitness #
################################################################################
gateway:
container_name: maf.gateway.stage
image: "ijohnnymiller/muscle-and-fitness-server.gateway:${TAG}"
depends_on:
service-registry:
condition: service_started
ports:
- "8080:8080"
restart: always
volumes:
- ~/docker-file-mapping/maf.logs:/logs
environment:
JAVA_TOOL_OPTIONS: -Xms128m -Xmx128m -Dspring.profiles.active=production
TZ: Asia/Hong_Kong
networks:
muscle_and_fitness_network:

################################################################################
# Network for Muscle and Fitness #
################################################################################
networks:
muscle_and_fitness_network:
ipam:
driver: default
# config:
# 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"
55 changes: 10 additions & 45 deletions docker/docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,13 @@ version: "3.7"
# In Kubernetes, 'container_name' must not be set. #
# 2. ${TAG} is defined in file '.env'. #
# 3. The differences between each environment docker-compose.yml: #
# a. Environmental suffix. There are 4 types of environmental suffix: #
# * '-dev_dkr' #
# * '-test' #
# * '-stage' #
# * '-prod' #
# b. 'subnet' and 'ipv4_address'. #
# 4. IP range definition (for instance of 'development-docker'): #
# a. 172.16.1.10 ~ 172.16.1.19: middleware of Muscle and Fitness #
# b. 172.16.1.19 ~ 172.16.1.253: microservice of Muscle and Fitness #
# c. 172.16.1.254: gateway for Muscle and Fitness #
# CAUTION: 172.16.1.255 is not available for container. #
# 5. Conceal some service ports: #
# a. api-portal #
# b. auth-center #
# c. exercise-mis #
# d. muscle-mis #
# 6. Define timezone for environment variable: Asia/Hong_Kong #
# 7. Define 'depends_on' for service #
# Environmental suffix. There are 4 types of environmental suffix: #
# * '.dev' #
# * '.test' #
# * '.stage' #
# * '.prod' #
# 4. Define timezone for environment variable: Asia/Hong_Kong #
# 5. Define 'depends_on' for service #
################################################################################

services:
Expand Down Expand Up @@ -181,9 +170,9 @@ services:
networks:
muscle_and_fitness_network:

api-portal:
container_name: maf.api-portal.test
image: "ijohnnymiller/muscle-and-fitness-server.api-portal:${TAG}"
api-gateway:
container_name: maf.api-gateway.test
image: "ijohnnymiller/muscle-and-fitness-gateway.api-portal:${TAG}"
depends_on:
mysql:
condition: service_started
Expand Down Expand Up @@ -258,34 +247,10 @@ services:
networks:
muscle_and_fitness_network:

################################################################################
# Gateway for Muscle and Fitness #
################################################################################
gateway:
container_name: maf.gateway.test
image: "ijohnnymiller/muscle-and-fitness-server.gateway:${TAG}"
depends_on:
service-registry:
condition: service_started
ports:
- "8080:8080"
restart: always
volumes:
- ~/docker-file-mapping/maf.logs:/logs
environment:
JAVA_TOOL_OPTIONS: -Xms128m -Xmx128m -Dspring.profiles.active=production
TZ: Asia/Hong_Kong
networks:
muscle_and_fitness_network:

################################################################################
# Network for Muscle and Fitness #
################################################################################
networks:
muscle_and_fitness_network:
ipam:
driver: default
# config:
# 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"

0 comments on commit 7359519

Please sign in to comment.