animeic 2 rokov pred
commit
7ff05a7ad7
6 zmenil súbory, kde vykonal 186 pridanie a 0 odobranie
  1. 36 0
      config-service.yaml
  2. 73 0
      docker-compose.yaml
  3. 56 0
      nginx/conf.d/default.conf
  4. 1 0
      nginx/www/index.html
  5. 16 0
      readme.md
  6. 4 0
      start.sh

+ 36 - 0
config-service.yaml

@@ -0,0 +1,36 @@
+log:
+  fileName: box-bus.log
+  level: 1
+  serviceName: box-bus
+  
+configer:
+  -
+    name: 3dshow-mongo
+    value: mongodb://root:3dshow@3dshow-mongo:27017/3dshow?authSource=admin
+    devValue: mongodb://root:3dshow@127.0.0.1:37031/3dshow?authSource=admin
+    # devValue: mongodb://root:boxcost@124.71.139.24:37030/box-cost?authSource=admin
+  # -
+  #   name: box-user-mongo
+  #   value: mongodb://root:boxcost@box-mongo:27017/box-user?authSource=admin
+  #   devValue: mongodb://root:boxcost@127.0.0.1:37030/box-user?authSource=admin
+    # devValue: mongodb://root:boxcost@124.71.139.24:37030/box-cost?authSource=admin
+
+  -
+    name: 3dshow-redis
+    value: 3dshow-redis:6379#0#default#pack3dshow
+    devValue: 127.0.0.1:16391#0#default#pack3dshow
+    # devValue: 124.71.139.24:16390#0#default#packbox
+
+# adapter:
+#   -
+#     busName: comm
+#     nats: nats://comm-bus:4222
+
+startLocalNats: true
+startNatsShellParams: "-p 4222 -m 8222 -js"
+startNatsPort: 4222
+
+nats:
+  url: nats://comm-bus:4222
+  maxReconnect: 10000
+  reconnDelaySecond: 5

+ 73 - 0
docker-compose.yaml

@@ -0,0 +1,73 @@
+version: '3.8'
+
+# 网络
+networks:
+  default:
+    external:
+      name: default-network
+    # name: default-network
+
+services:
+  #nginx反向代理
+  3dshow-nginx:
+    image: "registry.cn-chengdu.aliyuncs.com/infish/pack-comm-nginx:1.23.1"
+    restart: always
+    ports:
+      - 18089:80
+    volumes:
+      - ./nginx/conf.d:/etc/nginx/conf.d
+      - ./nginx/www:/usr/share/nginx/html
+
+  #bus消息中间件
+  3dshow-bus:
+    restart: always
+    image: registry.cn-chengdu.aliyuncs.com/infish/pack-comm-bus:v1.0.0
+    volumes:
+      - ./config-service.yaml:/root/bus/app.yaml
+
+    depends_on:
+      - box-mongo
+      - box-redis    
+    ports:
+      - 14301:4222
+
+  #redis缓存
+  3dshow-redis:
+    image: "redis:alpine"
+    restart: always
+    command:
+      --requirepass "boxcomm" #这一行是设置密码
+    privileged: true
+    ports:
+      - 16391:6379
+
+  #mongo 数据库
+  box-mongo:
+    image: mongo:4.4.1
+    restart: always
+    environment:
+      MONGO_INITDB_ROOT_USERNAME: root
+      MONGO_INITDB_ROOT_PASSWORD: 3dshow
+    volumes:
+      - ~/data/packs-3dshow/mongo/db:/data/db
+      - ~/data/packs-3dshow/mongo/log:/var/log/mongodb
+    ports: 
+      - 37031:27017
+
+  # cost 8888
+  3dshow:
+    image: registry.cn-chengdu.aliyuncs.com/infish/pack-3dshow:v1.0.0
+    restart: always
+    depends_on:
+      - 3dshow-bus
+    environment: 
+      NATS: nats://3dshow-bus:4222
+
+  # 用户中心 8908
+  # box-usercenter:
+  #   image: registry.cn-chengdu.aliyuncs.com/infish/pack-box-usercenter:v1.0.0
+  #   restart: always
+  #   depends_on:
+  #     - box-bus
+  #   environment: 
+  #     NATS: nats://box-bus:4222

+ 56 - 0
nginx/conf.d/default.conf

@@ -0,0 +1,56 @@
+server {
+    listen       80;
+    listen  [::]:80;
+    server_name  localhost;
+    #access_log  /var/log/nginx/host.access.log  main;
+    location / {
+        root   /usr/share/nginx/html;
+        index  index.html index.htm;
+    }
+    #error_page  404              /404.html;
+
+    # redirect server error pages to the static page /50x.html
+    #
+    error_page   500 502 503 504  /50x.html;
+    location = /50x.html {
+        root   /usr/share/nginx/html;
+    }
+
+    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
+    #
+    #location ~ \.php$ {
+    #    proxy_pass   http://127.0.0.1;
+    #}
+
+    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
+    #
+    #location ~ \.php$ {
+    #    root           html;
+    #    fastcgi_pass   127.0.0.1:9000;
+    #    fastcgi_index  index.php;
+    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
+    #    include        fastcgi_params;
+    #}
+
+    # deny access to .htaccess files, if Apache's document root
+    # concurs with nginx's one
+    #
+    #location ~ /\.ht {
+    #    deny  all;
+    #}
+
+    # 3dshow
+    location /3dshow/ {
+       proxy_pass  http://3dshow:8888/3dshow/;
+    }   
+
+    # 用户接口
+    # location /usercenter/ {
+    #    proxy_pass  http://box-usercenter:8908/usercenter/;
+    # }
+
+    #nats-exporter
+    # location /natsexporter/ {
+    #    proxy_pass  http://nats-exporter:7777/;
+    # }
+}

+ 1 - 0
nginx/www/index.html

@@ -0,0 +1 @@
+hello world~!!!

+ 16 - 0
readme.md

@@ -0,0 +1,16 @@
+
+https://3dqueen.cloud/3dshow/v1/3dshow/
+3dshow-nginx
+18089
+
+3dshow-mongo
+37031
+
+3dshow-redis
+16391
+
+3dshow-bus
+14301
+
+3dshow-usercenter
+https://3dqueen.cloud/3dshow/v1/usercenter/

+ 4 - 0
start.sh

@@ -0,0 +1,4 @@
+#!/bin/bash
+
+docker-compose up -d --remove-orphans
+docker-compose ps