docker-compose部署apollo

修改了apollo-configservice默认端口,数据库也需要修改eureka.service.url的端口

mysql:5.7.36自行部署mysql,然后按照如下导入sql

mysql -uroot -pxxx < apollo/scripts/sql/apolloportaldb.sql
 
mysql -uroot -pxxx < apollo/scripts/sql/apolloconfigdb.sql

vim apollo.yaml

version: '3'
services:
  apollo-portal:
    image: registry.cn-shenzhen.aliyuncs.com/lishanbin/apollo-portal:1.4.0
    container_name: apollo-portal
    network_mode: "host"
    environment:
      SERVER_PORT: 6165
      # DataSource Info
      DS_URL: "jdbc:mysql://192.168.10.18:3306/ApolloPortalDB?characterEncoding=utf8"
      DS_USERNAME: "root"
      DS_PASSWORD: "xxxxxx"
      # Environmental variable declaration (meta server url, different environments should have different meta server addresses)
      DEV_META: "http://192.168.0.18:6166"
      FAT_META: ""
      UAT_META: ""
      LPT_META: ""
      PRO_META: ""
    depends_on:
      - apollo-adminservice
    logging:
      driver: "json-file"
      options:
        max-size: "200k"
        max-file: "10"
 
  apollo-configservice:
    image: registry.cn-shenzhen.aliyuncs.com/lishanbin/apollo-configservice:1.4.0
    container_name: apollo-configservice
    network_mode: "host"
    environment:
      SERVER_PORT: 6166
      # DataSource Info
      DS_URL: "jdbc:mysql://192.168.10.18:3306/ApolloConfigDB?characterEncoding=utf8"
      DS_USERNAME: "root"
      DS_PASSWORD: "xxxxxx"
    logging:
      driver: "json-file"
      options:
        max-size: "200k"
        max-file: "10"
 
  apollo-adminservice:
    image: registry.cn-shenzhen.aliyuncs.com/lishanbin/apollo-adminservicel:1.4.0
    container_name: apollo-adminservice
    network_mode: "host"
    environment:
      SERVER_PORT: 6167
      # DataSource Info
      DS_URL: "jdbc:mysql://192.168.10.18:3306/ApolloConfigDB?characterEncoding=utf8"
      DS_USERNAME: "root"
      DS_PASSWORD: "xxxxxx"
    depends_on:
      - apollo-configservice
    logging:
      driver: "json-file"
      options:
        max-size: "200k"
        max-file: "10"

启动:docker-compose -f apollo.yaml up -d

访问:ip:6165

默认账号/密码 apollo/admin

系统信息没报错则部署成功:

docker-compose部署apollo_第1张图片

你可能感兴趣的:(docker,linux,运维)