# Daytona VNC/Computer Use image with OpenWork preinstalled.
#
# Use this for Electron/noVNC tests instead of the generic devcontainer image.
# The base image already contains the desktop stack Daytona expects:
# Xvfb, XFCE, x11vnc, noVNC, websockify, and dbus-x11.
FROM daytonaio/sandbox:0.6.0

USER root

RUN apt-get update \
  && apt-get install -y --no-install-recommends ffmpeg \
  && rm -rf /var/lib/apt/lists/*

RUN /usr/local/share/nvm/current/bin/npm install -g pnpm@10.27.0 bun

WORKDIR /workspace

RUN git clone --depth 1 --branch dev https://github.com/different-ai/openwork.git . \
  && mkdir -p /workspace/.openwork-daytona \
  && sha256sum /workspace/pnpm-lock.yaml | cut -d ' ' -f 1 > /workspace/.openwork-daytona/pnpm-lock.sha256 \
  && /usr/local/share/nvm/current/bin/npm cache clean --force \
  && git gc --prune=now \
  && rm -rf /root/.cache /root/.npm \
    /home/daytona/.cache /home/daytona/.npm /home/daytona/.local/share/pnpm/store \
    /workspace/node_modules /tmp/*

RUN chown -R daytona:daytona /workspace

USER daytona
