version: '3.8'

services:
  pinned_message:
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "8210:8210"
      - "8220:8220"
    networks:
      - crabs-network
    labels:
      # ПРАВИЛО 1: API на пути /api
      reproxy.1.server: "crabs-games.art"
      reproxy.1.route: "^/schedule/(.*)"
      reproxy.1.dest: "http://pinned_message:8210/schedule/$$1"
      reproxy.1.port: "8210"
      reproxy.1.ping: "/"
      
      # ПРАВИЛО 2: СТРАНИЦА SCHEDULE - путь /rodniki
      # Перенаправляем /schedule на веб-интерфейс (порт 8220)
      reproxy.2.server: "crabs-games.art"
      reproxy.2.route: "/rodniki"
      reproxy.2.dest: "http://pinned_message:8220/"
      reproxy.2.port: "8220"
      reproxy.2.ping: "/"

networks:
  crabs-network:
    name: crabs-network
    external: true
