version: '3'

services:
  server:
    image: git.dev.juetan.cn/juetan/server:latest
    networks:
      - public
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints: [node.role == manager]
      labels:
        - traefik.enable=true
        - traefik.http.routers.nest.rule=Host(`nest.dev.juetan.cn`) && PathPrefix(`/api`, `/upload`)
        - traefik.http.routers.nest.entrypoints=websecure
        - traefik.http.routers.nest.tls=true
        - traefik.http.routers.nest.tls.certresolver=acmer
        - traefik.http.services.nest1.loadbalancer.server.port=3030

  web:
    image: git.dev.juetan.cn/juetan/web:latest
    networks:
      - public
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints: [node.role == manager]
      labels:
        - traefik.enable=true
        - traefik.http.routers.vue.rule=Host(`nest.dev.juetan.cn`)
        - traefik.http.routers.vue.entrypoints=websecure
        - traefik.http.routers.vue.tls=true
        - traefik.http.routers.vue.tls.certresolver=acmer
        - traefik.http.services.vue1.loadbalancer.server.port=80

networks:
  public:
    external: true