boot版的Prod与docker-compose遇到配置问题的情况

Docker 未结 1 251
wscart
wscart 2019-09-02 00:39

#blade配置
blade:
  prop:
    upload-domain: http://localhost:8888
    remote-mode: true
    remote-path: /usr/share/nginx/html
    log-mode: true

1、这个部分是做什么用的?

2、在Docker容器里面情况可能是访问不到nginx容器或者无法正常获取nginx路径,这个怎么处理?


另外问题:docker-compose

version: '3'
services:
demo-nginx:
image: nginx:latest
hostname: "demo-nginx"
environment:
- TZ=Asia/Shanghai
ports:
- 80:80
- 443:443
volumes:
- ./wwwroot:/usr/share/nginx/html
- ./nginx/conf:/etc/nginx/conf.d
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/logs:/var/log/nginx
privileged: true
restart: always
networks:
- demo_net

demo-mysql:
image: mysql:5.7.27
hostname: "demo-mysql"
environment:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
volumes:
- ./mysql/db/conf:/etc/mysql/conf.d
- ./mysql/db/logs:/logs
- ./mysql/db/data:/var/lib/mysql
- ./mysql/conf/my.cnf:/etc/my.cnf
- ./mysql/init:/docker-entrypoint-initdb.d/
privileged: true
restart: always
networks:
- demo_net

demo-redis:
image: redis:latest
hostname: "demo-redis"
environment:
- TZ=Asia/Shanghai
ports:
- 6379:6379
volumes:
- ./redis:/data
command: "redis-server --appendonly yes"
privileged: true
restart: always
networks:
- demo_net

demo-server:
image: registry.cn-hangzhou.aliyuncs.com/demo/demo_server:2.0.7.RELEASE
environment:
- TZ=Asia/Shanghai
ports:
- 8800:8800
privileged: true
restart: always
networks:
- demo_net

demo-flowable:
image: registry.cn-hangzhou.aliyuncs.com/demo/demo_flowable:2.0.7.RELEASE
environment:
- TZ=Asia/Shanghai
ports:
- 9999:9999
privileged: true
restart: always
networks:
- demo_net

demo-html:
image: registry.cn-hangzhou.aliyuncs.com/demo/demo_html:latest
environment:
- TZ=Asia/Shanghai
ports:
- 8888:8888
privileged: true
restart: always
networks:
- demo_net

networks:
demo_net:
driver: bridge
ipam:
config:
- subnet: 172.30.0.0/16

这个配置问题是,每个容器都是不固定IP导致那些容器无法互通

 比如ant.design.pro配置localhost:9999 这个访问不到另一个flow容器


1条回答
  • 2019-09-02 21:57

    1.本地上传文件配置,目前使用oss替代,基本弃用

    2.各微服务发布docker服务后,会有一个内网ip,如果不做设置是无法互相联通的。需要指定同一个子网

    3.在docker-compose内指定

    blade-resource:
      image: "${REGISTER}/blade/blade-resource:${TAG}"
      。。。。。。。
      networks:
        - blade_net
    networks:
      blade_net:
        driver: bridge
        ipam:
          config:
          - subnet: 172.30.0.0/16


    0 讨论(0)
提交回复