From feb49a459434cf9be2abc6acfbb8ba16adfc53ca Mon Sep 17 00:00:00 2001
From: ValueOn AG
Date: Mon, 16 Feb 2026 22:10:43 +0100
Subject: [PATCH] feat: add Xvfb for headful browser mode (Teams blocks
headless)
Co-authored-by: Cursor
---
Dockerfile | 10 +++++++---
docker-compose.yml | 3 ++-
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index 403b7f4..a242d35 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -21,6 +21,9 @@ FROM mcr.microsoft.com/playwright:v1.50.0-jammy
WORKDIR /app
+# Install Xvfb for headful browser mode (Teams blocks headless browsers)
+RUN apt-get update && apt-get install -y xvfb && rm -rf /var/lib/apt/lists/*
+
# Copy built files and dependencies
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
@@ -31,7 +34,8 @@ RUN mkdir -p output/logs output/screenshots
# Set environment
ENV NODE_ENV=production
-ENV BOT_HEADLESS=true
+ENV BOT_HEADLESS=false
+ENV DISPLAY=:99
# Expose port
EXPOSE 4100
@@ -40,5 +44,5 @@ EXPOSE 4100
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:4100/health || exit 1
-# Run
-CMD ["node", "dist/index.js"]
+# Start Xvfb in background, then run the bot
+CMD Xvfb :99 -screen 0 1280x720x24 -nolisten tcp & node dist/index.js
diff --git a/docker-compose.yml b/docker-compose.yml
index d6dbc37..84d8f22 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -10,7 +10,8 @@ services:
- PORT=4100
- GATEWAY_WS_URL=${GATEWAY_WS_URL:-wss://gateway-int.poweron-center.net/api/teamsbot/ws}
- BOT_NAME=${BOT_NAME:-PowerOn AI}
- - BOT_HEADLESS=true
+ - BOT_HEADLESS=false
+ - DISPLAY=:99
- LOG_LEVEL=info
- SCREENSHOT_ON_ERROR=true
volumes: