2023-10-17 19:48:45 +08:00
|
|
|
|
version: '3.9'
|
2023-11-01 21:26:54 +08:00
|
|
|
|
name: demo01-native
|
2023-10-17 19:48:45 +08:00
|
|
|
|
services:
|
2023-10-29 19:48:16 +08:00
|
|
|
|
demo01-native:
|
|
|
|
|
image: svn.youshengyun.com:9924/demo01-native:1.0
|
|
|
|
|
container_name: demo01-native
|
2023-11-01 21:26:54 +08:00
|
|
|
|
hostname: demo01-native
|
2023-10-17 19:48:45 +08:00
|
|
|
|
restart: unless-stopped
|
|
|
|
|
extra_hosts:
|
|
|
|
|
- "host.docker.internal:host-gateway"
|
|
|
|
|
networks:
|
|
|
|
|
- y9-share-net
|
|
|
|
|
ports:
|
2023-11-04 13:42:50 +08:00
|
|
|
|
- "7057:7057"
|
2023-10-29 19:48:16 +08:00
|
|
|
|
environment:
|
2023-11-04 13:38:14 +08:00
|
|
|
|
server.port: 7057
|
|
|
|
|
server.servlet.context-path: '/demo01'
|
2023-10-27 13:36:45 +08:00
|
|
|
|
labels:
|
2023-11-04 13:38:14 +08:00
|
|
|
|
# 定义demo01-native路由,entrypoints=web,接受http请求
|
2023-10-27 13:36:45 +08:00
|
|
|
|
- "traefik.enable=true"
|
2023-10-30 10:07:50 +08:00
|
|
|
|
- "traefik.http.routers.demo01-native.entrypoints=web"
|
|
|
|
|
- "traefik.http.routers.demo01-native.rule=PathPrefix(`/demo01`)"
|
2023-11-04 13:38:14 +08:00
|
|
|
|
|
|
|
|
|
# 定义demo01服务
|
|
|
|
|
- "traefik.http.services.demo01.loadbalancer.passHostHeader=true"
|
|
|
|
|
- "traefik.http.services.demo01.loadbalancer.server.port=7057"
|
|
|
|
|
|
|
|
|
|
# 指定路由demo01-native的服务为demo01
|
2023-11-02 11:16:55 +08:00
|
|
|
|
- "traefik.http.routers.demo01-native.service=demo01"
|
|
|
|
|
|
2023-11-04 13:38:14 +08:00
|
|
|
|
# 默认轮询的方式进行负载,session sticky放开下面的注释
|
|
|
|
|
#- "traefik.http.services.demo01.loadbalancer.sticky.cookie.name=demo01"
|
|
|
|
|
|
|
|
|
|
# 定义SSL,entrypoints=web-ssl,接受https请求,路由和服务要重新定义一次
|
2023-11-02 11:16:55 +08:00
|
|
|
|
- "traefik.http.routers.demo01-native-ssl.tls=true"
|
|
|
|
|
- "traefik.http.routers.demo01-native-ssl.entrypoints=web-ssl"
|
|
|
|
|
- "traefik.http.routers.demo01-native-ssl.rule=PathPrefix(`/demo01`)"
|
2023-11-04 13:38:14 +08:00
|
|
|
|
- "traefik.http.routers.demo01-native-ssl.service=demo01"
|
|
|
|
|
|
|
|
|
|
# HTTP 协议自动跳转 HTTPS
|
|
|
|
|
#- "traefik.http.middlewares.to-https.redirectscheme.scheme=https"
|
|
|
|
|
#- "traefik.http.middlewares.to-https.redirectscheme.permanent=true"
|
|
|
|
|
#- "traefik.http.middlewares.to-https.redirectscheme.port=7443"
|
|
|
|
|
#- "traefik.http.routers.demo01-jib.middlewares=to-https"
|
2023-10-17 19:48:45 +08:00
|
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
y9-share-net:
|
|
|
|
|
external: true
|