services:
  api-reference:
    image: scalarapi/api-reference:latest
    restart: unless-stopped
    networks:
      scalar__user_network:
        gw_priority: 0
      tipi_main_network:
        gw_priority: 1
    environment:
      API_REFERENCE_CONFIG: ${FORM_API_REFERENCE_CONFIG}
      PROXY_URL: ${FORM_PROXY_URL}
    ports:
      - ${APP_PORT}:8080
    volumes:
      - /etc/runtipi/app-data/runtipi/scalar/apidocs:/docs
    labels:
      generated: true
      traefik.enable: true
      traefik.docker.network: runtipi_tipi_main_network
      traefik.http.middlewares.scalar-_user-web-redirect.redirectscheme.scheme: https
      traefik.http.services.scalar-_user.loadbalancer.server.port: "8080"
      traefik.http.routers.scalar-_user-insecure.rule: Host(`${APP_DOMAIN}`)
      traefik.http.routers.scalar-_user-insecure.entrypoints: web
      traefik.http.routers.scalar-_user-insecure.service: scalar-_user
      traefik.http.routers.scalar-_user-insecure.middlewares: scalar-_user-web-redirect
      traefik.http.routers.scalar-_user.rule: Host(`${APP_DOMAIN}`)
      traefik.http.routers.scalar-_user.entrypoints: websecure
      traefik.http.routers.scalar-_user.service: scalar-_user
      traefik.http.routers.scalar-_user.tls.certresolver: myresolver
      runtipi.managed: true
      runtipi.appurn: scalar:_user
    hostname: scalar-api
networks:
  tipi_main_network:
    name: runtipi_tipi_main_network
    external: true
  scalar__user_network:
    name: scalar__user_network
    external: false
    ipam:
      config:
        - subnet: 10.128.22.0/24

