demo-boot-demoapi.yaml 1.5 KB
Newer Older
1 2 3 4 5
version: "3.2"
services:
  demo-boot:
    image: dstimage
    ports:
6
      - "52000:52000"
7 8 9 10
    networks:
      - agent_network
    environment:
      - SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.110
11
      - SERVER_PORT=52000
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
      - SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.240.110:8848
      - SPRING_CLOUD_NACOS_CONFIG_SERVER-ADDR=172.16.240.110:8848
      - SPRING_REDIS_HOST=172.16.240.110
      - SPRING_REDIS_PORT=6379
      - SPRING_REDIS_DATABASE=0
      - SPRING_DATASOURCE_USERNAME=a_LAB01_df847bdfd
      - SPRING_DATASOURCE_PASSWORD=3d6@460A
      - SPRING_DATASOURCE_URL=jdbc:mysql://172.16.186.185:3306/a_LAB01_df847bdfd?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true&serverTimezone=GMT%2B8
      - SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
      - SPRING_DATASOURCE_DEFAULTSCHEMA=a_LAB01_df847bdfd
      - NACOS=172.16.240.110:8848
      - SEATA_REGISTRY_NACOS_SERVER-ADDR=172.16.240.110:8848
      - SEATA_ENABLED=true
    deploy:
      resources:
           limits:
               memory: 4048M
           reservations:
               memory: 400M    
      mode: replicated
      replicas: 1
      restart_policy:
        condition: on-failure
        max_attempts: 3
        window: 120s
    volumes:
      - "nfs:/app/file"

volumes:
  nfs:
    driver: local
    driver_opts:
      type: "nfs"
      o: "addr=172.16.240.140,rw"
      device: ":/data/nfs"

networks:
  agent_network:
    driver: overlay
    attachable: true