docker-compose常用配置


version: '3'
services:
  nginx-route:
    image: hub.deri.org.cn/library/nginx
    container_name: nginx-route
    ports:
    - "8080:80"
    restart: always
    volumes:
    - "/etc/localtime:/etc/localtime"
    - "/wuzhiyong/nginx.conf:/etc/nginx/nginx.conf"
  authservice:
    image: wuzhiyong/authservice
    container_name: authservice
    restart: always
    volumes:
    - "/etc/localtime:/etc/localtime"
  dbcompare:
    image: wuzhiyong/dbcompare
    container_name: dbcompare
    restart: always
    volumes:
    - "/etc/localtime:/etc/localtime"
  graphcompare:
    image: wuzhiyong/graphcompare
    container_name: graphcompare
    restart: always
    volumes:
    - "/etc/localtime:/etc/localtime"
    - "/wuzhiyong/svg:/root/svg"
  hbasecompare:
    image: wuzhiyong/hbasecompare
    container_name: hbasecompare
    restart: always
    volumes:
    - "/etc/localtime:/etc/localtime"
    extra_hosts:
    - "hadoop1:172.16.0.7"
    - "hadoop2:172.16.0.8"
    - "hadoop3:172.16.0.9"
  taskservice:
    image: wuzhiyong/taskservice
    container_name: taskservice
    restart: always
    volumes:
    - "/etc/localtime:/etc/localtime"
networks:
  nwzb:
user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;

    upstream taskservice{
        server taskservice:28080;
    }

    upstream authservice{
        server authservice:25050;
    }

    upstream dbcompare{
        server dbcompare:28082;
    }

    upstream hbasecompare{
        server hbasecompare:26060;
    }

    upstream graphcompare{
        server graphcompare:29090;
    }

    server {
        listen    80 default_server;
        server_name _;
    location /ts {
        proxy_pass    http://taskservice;
    }
        location /auth {
            proxy_pass  http://authservice;
        }
        location /dbc {
            proxy_pass  http://dbcompare;
        }
        location /hbc {
            proxy_pass  http://hbasecompare;
        }
        location /graph {
            proxy_pass  http://graphcompare;
        }
    }
}

文章作者: wuzhiyong
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 wuzhiyong !
评论
 上一篇
maven配置编译环境 maven配置编译环境
<properties> <java.version>1.8</java.version> <maven.compiler.source>1.8</maven.compiler.source>
2021-01-16
下一篇 
java容器中时区问题 java容器中时区问题
问题容器时间与主机差8个小时,如果里面运行的是java程序,那么程序时间还是有8个小时时差. 解决 容器内时间与宿主机时间不一样```sh#启动容器时增加 v /etc/localtime:/etc/localtime java时区主要
2020-12-31
  目录