Parcourir la source

Docker-compose

xucaiqin il y a 1 an
Parent
commit
fd8749b08d
1 fichiers modifiés avec 125 ajouts et 0 suppressions
  1. 125 0
      docker-compose.yml

+ 125 - 0
docker-compose.yml

@@ -0,0 +1,125 @@
+version: '3'
+
+services:
+  nacos:
+    image: nacos/nacos-server:v2.2.1
+    ports:
+      - '8848:8848'
+      - '9848:9848'
+    container_name: nacos
+    environment:
+      - MODE=standalone
+      - PREFER_HOST_MODE=hostname
+      - SPRING_DATASOURCE_PLATFORM=mysql
+    hostname: nacos
+    networks:
+      iot:
+        aliases:
+          - nacos
+  mysql:
+    image: mysql:latest
+    ports:
+      - '3306:3306'
+      - '33060:33060'
+    container_name: mysql
+    environment:
+      - MYSQL_ROOT_PASSWORD=xucaiqin
+    hostname: mysql
+    volumes:
+      - mysql:/var/lib/mysql
+    networks:
+      iot:
+        aliases:
+          - mysql
+  redis:
+    image: redis:7.0-alpine
+    ports:
+      - '6379:6379'
+    container_name: redis
+    command:
+      - redis-server --requirepass xucaiqin
+    hostname: redis
+    networks:
+      iot:
+        aliases:
+          - redis
+  gateway:
+    build:
+      context: ./iot-gateway
+      dockerfile: ./Dockerfile
+    container_name: iot-gateway
+    ports:
+      - '9000:9000'
+    environment:
+      - PROFILES=local
+    hostname: iot-gateway
+    networks:
+      iot:
+        aliases:
+          - iot-gateway
+
+  system:
+    build:
+      context: ./iot-module/iot-module-system
+      dockerfile: ./Dockerfile
+    container_name: iot-system
+    ports:
+      - '9002:9002'
+    environment:
+      - PROFILES=local
+    hostname: iot-system
+    networks:
+      iot:
+        aliases:
+          - iot-system
+  auth:
+    build:
+      context: ./iot-module/iot-module-auth
+      dockerfile: ./Dockerfile
+    container_name: iot-auth
+    ports:
+      - '9001:9001'
+    environment:
+      - PROFILES=local
+    hostname: iot-auth
+    networks:
+      iot:
+        aliases:
+          - iot-auth
+  manage:
+    build:
+      context: ./iot-module/iot-module-manage
+      dockerfile: ./Dockerfile
+    container_name: iot-manage
+    ports:
+      - '9003:9003'
+    environment:
+      - PROFILES=local
+    hostname: iot-manage
+    networks:
+      iot:
+        aliases:
+          - iot-manage
+
+  data:
+    build:
+      context: ./iot-module/iot-module-data
+      dockerfile: ./Dockerfile
+    container_name: iot-data
+    ports:
+      - '9004:9004'
+    environment:
+      - PROFILES=local
+    hostname: iot-data
+    networks:
+      iot:
+        aliases:
+          - iot-data
+networks:
+  iot:
+    driver: bridge
+
+volumes:
+  mysql:
+
+