Kaynağa Gözat

压测提交

liliang 7 ay önce
ebeveyn
işleme
e93bbad706

+ 2 - 2
game/config/profile-gc.json

@@ -237,7 +237,7 @@
     ]
   },
   "redis": {
-    "address": "127.0.0.1:6379",
+    "address": "s5.z100.vip:36379",
     "password": "",
     "db": 0,
     "tls": 0
@@ -253,7 +253,7 @@
     "redis": {
       "prefix_key": "data_config",
       "subscribe_key": "data_config_change",
-      "address": "127.0.0.1:6379",
+      "address": "s5.z100.vip:36379",
       "password": "",
       "db": 7,
       "tls": 0

+ 44 - 0
z-deploy/docker/docker-compose.yml

@@ -104,6 +104,50 @@ services:
       - .:/app  # 如果需要将本地代码挂载到容器中进行开发
       - ./config:/config  # 挂载宿主机的配置文件目录到容器内的 /config
     restart: always
+    command: ["sh","-c","./game game --path=/config/profile-gc.json --node=10001"]
+    networks:
+      - my_custom_network
+    depends_on:
+      - etcd
+      - nats
+      - redis
+      - mongodb
+      - center
+
+  game-2:
+    build:
+      context: ./game
+      dockerfile: Dockerfile
+    container_name: game-2
+    environment:
+      - GO_ENV=development  # 可以根据需要设置环境变量
+    volumes:
+      - .:/app  # 如果需要将本地代码挂载到容器中进行开发
+      - ./config:/config  # 挂载宿主机的配置文件目录到容器内的 /config
+    restart: always
+    command: ["sh","-c","./game game --path=/config/profile-gc.json --node=10002"]
+    networks:
+      - my_custom_network
+    depends_on:
+      - etcd
+      - nats
+      - redis
+      - mongodb
+      - center
+
+
+  game-3:
+    build:
+      context: ./game
+      dockerfile: Dockerfile
+    container_name: game-3
+    environment:
+      - GO_ENV=development  # 可以根据需要设置环境变量
+    volumes:
+      - .:/app  # 如果需要将本地代码挂载到容器中进行开发
+      - ./config:/config  # 挂载宿主机的配置文件目录到容器内的 /config
+    restart: always
+    command: [ "sh","-c","./game game --path=/config/profile-gc.json --node=10003" ]
     networks:
       - my_custom_network
     depends_on:

+ 1 - 1
z-deploy/docker/game/Dockerfile

@@ -13,4 +13,4 @@ RUN chmod +x ./game
 #EXPOSE 8080
 
 # 运行应用程序
-ENTRYPOINT ["sh","-c","./game game --path=/config/profile-gc.json --node=10001"]
+#ENTRYPOINT ["sh","-c","./game game --path=/config/profile-gc.json --node=10001"]