services:
  backend:
    networks:
      - default
      - proxy
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=proxy"
      - "traefik.http.routers.walkup-backend.rule=Host(`${APP_HOST}`) && PathPrefix(`/api`)"
      - "traefik.http.routers.walkup-backend.entrypoints=websecure"
      - "traefik.http.routers.walkup-backend.tls=true"
      - "traefik.http.routers.walkup-backend.priority=100"
      - "traefik.http.routers.walkup-backend.middlewares=walkup-api-strip"
      - "traefik.http.services.walkup-backend.loadbalancer.server.port=8000"
      - "traefik.http.middlewares.walkup-api-strip.stripprefix.prefixes=/api"

  frontend:
    networks:
      - default
      - proxy
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=proxy"
      - "traefik.http.routers.walkup-frontend.rule=Host(`${APP_HOST}`)"
      - "traefik.http.routers.walkup-frontend.entrypoints=websecure"
      - "traefik.http.routers.walkup-frontend.tls=true"
      - "traefik.http.routers.walkup-frontend.priority=1"
      - "traefik.http.services.walkup-frontend.loadbalancer.server.port=5173"

networks:
  proxy:
    external: true
