# FOCAS simulator — focas-mock JSON/TCP + native FOCAS2 Ethernet server.
#
# The image is built from the vendored focas-mock snapshot at ./focas-mock/
# (see focas-mock/VENDORED.md for refresh procedure).
#
# Usage:
#   docker compose -f Docker/docker-compose.yml up -d --wait
#   docker compose -f Docker/docker-compose.yml down
#
# One service, one container — the mock's native FOCAS Ethernet responder
# auto-detects the binary PDU prefix (`a0 a0 a0 a0`) on the same TCP port
# that serves JSON admin commands. Tests that need per-series behaviour
# call `mock_load_profile` via the fixture's admin API at test start.
# The pre-wire-client era had one compose profile per CNC series; that
# ceremony is gone because the managed wire client doesn't depend on a
# per-series shim DLL.

services:
  focas-sim:
    image: otopcua-focas-sim:latest
    build:
      context: ./focas-mock
      dockerfile: Dockerfile
    container_name: otopcua-focas-sim
    ports:
      - "8193:8193"
    restart: "no"
    command: ["--profile", "FWLIB64"]
    healthcheck:
      test: ["CMD-SHELL", "python -c \"import socket; s=socket.create_connection(('127.0.0.1',8193),timeout=2); s.close()\" || exit 1"]
      interval: 10s
      timeout: 3s
      retries: 3
      start_period: 5s
