docker-compose.yml 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. version: '3'
  2. services:
  3. tl_api:
  4. build:
  5. context: .
  6. dockerfile: ./Dockerfile
  7. image: registry.yingcaibx.com/tl/api:latest
  8. restart: always
  9. container_name: tl_api
  10. environment:
  11. - SPRING_DATASOURCE_DYNAMIC_DATASOURCE_MASTER_URL=jdbc:mysql://172.28.175.70:3306/tl?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
  12. - SPRING-REDIS-HOST=172.28.175.70
  13. - MQTT-SERVER=tcp://172.28.175.70:1883
  14. networks:
  15. - docker_networks_default
  16. deploy: #限制资源使用
  17. resources:
  18. limits:
  19. cpus: '0.50'
  20. memory: 2048M
  21. labels:
  22. - "traefik.http.routers.tl_api.rule=Host(`test.tl.web.yingcaibx.com`) && PathPrefix(`/api`)"
  23. - "traefik.http.routers.tl_api.middlewares=tl_api-stripprefix"
  24. - "traefik.http.middlewares.tl_api-stripprefix.stripprefix.prefixes=/api"
  25. - "traefik.http.routers.tl_api.entrypoints=websecure"
  26. - "traefik.http.routers.tl_api.tls.certresolver=yxt"
  27. networks:
  28. docker_networks_default:
  29. external: true