apollo-1.9.2
docker-compose.yaml
version: '3'
services:
# 模拟一个正常的mysql数据库
mysql8:
image: mysql:5.7
restart: always
container_name: mysql
ports:
- 3306:3306
volumes:
- ./databases/mysql/logs:/var/log/mysql
- ./databases/mysql/data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=wjht#%$347
# - MYSQL_ALLOW_EMPTY_PASSWORD=1
command:
--max_connections=1000
--character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci
--default-authentication-plugin=mysql_native_password
--lower_case_table_names=1
networks:
SaasNet:
ipv4_address: 19.16.2.3
apollo-configservice:
container_name: apollo_configservice
image: apolloconfig/apollo-configservice:1.9.2
restart: always
depends_on:
- mysql8
environment:
SPRING_DATASOURCE_URL: 'jdbc:mysql://mysql8:3306/ApolloConfigDB?characterEncoding=utf8'
SPRING_DATASOURCE_USERNAME: 'root'
SPRING_DATASOURCE_PASSWORD: 'wjht#%$347'
#JAVA_OPTS: "-Deureka.instance.homePageUrl=http://192.168.1.234:8080"
JAVA_OPTS: "-Deureka.instance.homePageUrl=http://19.16.2.5:8080"
# EUREKA_INSTANCE_HOME_PAGE_URL: http://192.168.1.234:8080
# EUREKA_INSTANCE_PREFER_IP_ADDRESS: false
volumes:
- ./saastools/apollo-configservice/logs:/opt/logs
ports:
- "8080:8080"
networks:
SaasNet:
ipv4_address: 19.16.2.5
#核心接口服务
apollo-adminservice:
container_name: apollo_adminservice
image: apolloconfig/apollo-adminservice:1.9.2
restart: always
environment:
SPRING_DATASOURCE_URL: 'jdbc:mysql://mysql8:3306/ApolloConfigDB?characterEncoding=utf8'
SPRING_DATASOURCE_USERNAME: 'root'
SPRING_DATASOURCE_PASSWORD: 'wjht#%$347'
#JAVA_OPTS: "-Deureka.instance.homePageUrl=http://192.168.1.234:8090 -Deureka.service.url=http://192.168.1.234:8080/eureka/ "
JAVA_OPTS: "-Deureka.instance.homePageUrl=http://19.16.2.6:8090 -Deureka.service.url=http://19.16.2.5:8080/eureka/ "
depends_on:
- mysql8
- apollo-configservice
ports:
- "8090:8090"
volumes:
- ./saastools/apollo-adminservice/logs/:/opt/logs
networks:
SaasNet:
ipv4_address: 19.16.2.6
apollo-portal:
image: apolloconfig/apollo-portal:1.9.2
container_name: apollo_portal
restart: always
environment:
SPRING_DATASOURCE_URL: 'jdbc:mysql://mysql8:3306/ApolloPortalDB?characterEncoding=utf8'
SPRING_DATASOURCE_USERNAME: 'root'
SPRING_DATASOURCE_PASSWORD: 'wjht#%$347'
APOLLO_PORTAL_ENVS: 'dev'
#DEV_META: 'http://192.168.1.234:8080'
DEV_META: 'http://19.16.2.5:8080'
# 默认账号 apollo admin
depends_on:
- mysql8
- apollo-configservice
ports:
- "8070:8070"
volumes:
- ./saastools/apollo-portal/logs/:/opt/logs
networks:
SaasNet:
ipv4_address: 19.16.2.7
networks:
SaasNet:
name: SaasNet
driver: bridge
ipam:
config:
- subnet: 19.16.2.0/24
gateway: 19.16.2.1
标签:compose,http,SPRING,19.16,DATASOURCE,mysql,docker,apollo
From: https://www.cnblogs.com/sddll/p/18069991