docker-compose.yml 1.0 KB

123456789101112131415161718192021222324252627282930
  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. # - MQTT-SERVER=tcp://172.28.175.70:1883
  13. networks:
  14. - docker_networks_default
  15. deploy: #限制资源使用
  16. resources:
  17. limits:
  18. cpus: '0.50'
  19. memory: 2048M
  20. labels:
  21. - "traefik.http.routers.tl_api.rule=Host(`test.tl.web.yingcaibx.com`) && PathPrefix(`/api`)"
  22. - "traefik.http.routers.tl_api.middlewares=tl_api-stripprefix"
  23. - "traefik.http.middlewares.tl_api-stripprefix.stripprefix.prefixes=/api"
  24. - "traefik.http.routers.tl_api.entrypoints=websecure"
  25. - "traefik.http.routers.tl_api.tls.certresolver=yxt"
  26. networks:
  27. docker_networks_default:
  28. external: true