# CUA Windows Container
#
# A Windows 11 VM with cua-computer-server for Computer-Use Agents.
#
# Build variants:
#   - Minimal (default): Python, Git, cua-computer-server
#   - Windows Arena: All benchmark apps (Chrome, LibreOffice, VLC, etc.)
#
# Build commands:
#   Minimal:      docker build -f Dockerfile-CUA-Windows -t trycua/cua-windows:latest .
#   Windows Arena: docker build -f Dockerfile-CUA-Windows --build-arg INSTALL_WINARENA_APPS=true -t trycua/winarena:latest .
#
# Environment variables (set at build time or runtime):
#   INSTALL_WINARENA_APPS - "true" to install Windows Arena benchmark apps
#   RAM_SIZE              - VM RAM (default: 8G)
#   CPU_CORES             - VM CPUs (default: 8)
#   DISK_SIZE             - VM disk size (default: 30G)

FROM trycua/windows-local:latest

# Build argument for Windows Arena apps
ARG INSTALL_WINARENA_APPS=false

# Copy setup scripts to shared folder (accessible via \\host.lan\Data in Windows)
COPY vm/setup/setup-unified.ps1 /shared/setup.ps1
COPY vm/setup/setup-tools.psm1 /shared/setup-tools.psm1
COPY vm/setup/tools_config.json /shared/tools_config.json
COPY vm/setup/on-logon.ps1 /shared/on-logon.ps1

# Copy entry script
COPY entry-cua.sh /entry.sh
RUN chmod +x /entry.sh

# VM configuration
ENV RAM_SIZE="8G"
ENV CPU_CORES="8"
ENV DISK_SIZE="30G"
ENV VERSION="win11x64-enterprise-eval"

# Enable QEMU Machine Protocol for VM control
ENV ARGUMENTS="-qmp tcp:0.0.0.0:7200,server,nowait"

# Pass build arg as env var for golden image creation
ENV INSTALL_WINARENA_APPS=${INSTALL_WINARENA_APPS}

# Expose ports
#   5000 - cua-computer-server API
#   8006 - noVNC web interface
EXPOSE 5000 8006

ENTRYPOINT ["/entry.sh"]
