feat: add Xvfb for headful browser mode (Teams blocks headless)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
ValueOn AG 2026-02-16 22:10:43 +01:00
parent cc17f638cd
commit feb49a4594
2 changed files with 9 additions and 4 deletions

View file

@ -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

View file

@ -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: