version: '3' services: nginx: image: nginx:1.22.0 restart: always networks: - web - internal expose: - 80 ports: - "8011:80" extra_hosts: - host.docker.internal:host-gateway volumes: - ./deploy/nginx/templates:/etc/nginx/templates - $PWD:/var/www/html labels: - "traefik.enable=true" - "traefik.docker.network=web" - "traefik.http.routers.https-buyer-or-seller-jingcai-html-dist-${ENV_NAME}-buy.tls=true" - "traefik.http.routers.https-buyer-or-seller-jingcai-html-dist-${ENV_NAME}-buy.tls.certresolver=myresolver" - "traefik.http.routers.https-buyer-or-seller-jingcai-html-dist-${ENV_NAME}-buy.rule=Host(`$BUYER_DOMAIN`)" - "traefik.http.routers.https-buyer-or-seller-jingcai-html-dist-${ENV_NAME}-buy.service=buyer-or-seller-jingcai-html-dist-${ENV_NAME}-buy" - "traefik.http.routers.http-buyer-or-seller-jingcai-html-dist-${ENV_NAME}-buy.rule=Host(`$BUYER_DOMAIN`)" - "traefik.http.routers.http-buyer-or-seller-jingcai-html-dist-${ENV_NAME}-buy.service=buyer-or-seller-jingcai-html-dist-${ENV_NAME}-buy" - "traefik.http.services.buyer-or-seller-jingcai-html-dist-${ENV_NAME}-buy.loadbalancer.server.port=80" - "traefik.http.routers.https-buyer-or-seller-jingcai-html-dist-${ENV_NAME}-seller.tls=true" - "traefik.http.routers.https-buyer-or-seller-jingcai-html-dist-${ENV_NAME}-seller.tls.certresolver=myresolver" - "traefik.http.routers.https-buyer-or-seller-jingcai-html-dist-${ENV_NAME}-seller.rule=Host(`$SELLER_DOMAIN`)" - "traefik.http.routers.https-buyer-or-seller-jingcai-html-dist-${ENV_NAME}-seller.service=buyer-or-seller-jingcai-html-dist-${ENV_NAME}-seller" - "traefik.http.routers.http-buyer-or-seller-jingcai-html-dist-${ENV_NAME}-seller.rule=Host(`$SELLER_DOMAIN`)" - "traefik.http.routers.http-buyer-or-seller-jingcai-html-dist-${ENV_NAME}-seller.service=buyer-or-seller-jingcai-html-dist-${ENV_NAME}-seller" - "traefik.http.services.buyer-or-seller-jingcai-html-dist-${ENV_NAME}-seller.loadbalancer.server.port=80" #- "traefik.http.services.jingcai-html-dist.loadbalancer.server.port=80" networks: internal: external: false web: external: true # curl http://buyer.daxiangzj.com:8011 --resolve buyer.daxiangzj.com:8011:127.0.0.1 # curl http://seller.daxiangzj.com:8011 --resolve seller.daxiangzj.com:8011:127.0.0.1