<?xml version="1.0" encoding="UTF-8"?>
<!--
  WinSW config for ANTOOZA Frontend (Next.js 15 standalone).
  Deploy path: F:\IIS\ANTOOZA\Front
  Required files in folder (after first Jenkins build pushes server.js + .next + public):
    - server.js              (from .next/standalone/)
    - .next/                 (server bundles + .next/static client assets)
    - public/                (public assets)
    - node_modules/          (minimal, from standalone)
    - antooza-frontend.exe      (renamed WinSW v2 binary; kept by Jenkinsfile rollout)
    - antooza-frontend.xml      (this file)
    - web.config             (IIS reverse proxy config)
  Install once: antooza-frontend.exe install
  Jenkinsfile then manages Start/Stop via Stop-Service / Start-Service.
-->
<service>
  <id>antooza-frontend</id>
  <name>ANTOOZA Frontend (Next.js standalone)</name>
  <description>Next.js production server for dev.antooza.com / antooza.com (port 3000)</description>

  <executable>node</executable>
  <arguments>server.js</arguments>
  <workingdirectory>F:\IIS\ANTOOZA\Front</workingdirectory>

  <env name="NODE_ENV" value="production"/>
  <env name="PORT" value="3000"/>
  <env name="HOSTNAME" value="127.0.0.1"/>
  <env name="NODE_TLS_REJECT_UNAUTHORIZED" value="1"/>

  <log mode="roll-by-size">
    <sizeThreshold>10240</sizeThreshold>
    <keepFiles>5</keepFiles>
  </log>

  <onfailure action="restart" delay="10 sec"/>
  <onfailure action="restart" delay="30 sec"/>
  <onfailure action="restart" delay="60 sec"/>

  <resetfailure>1 hour</resetfailure>

  <stoptimeout>30 sec</stoptimeout>
  <stopparentprocessfirst>true</stopparentprocessfirst>
</service>
