feat: add Xvfb for headful browser mode (Teams blocks headless)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
cc17f638cd
commit
feb49a4594
2 changed files with 9 additions and 4 deletions
10
Dockerfile
10
Dockerfile
|
|
@ -21,6 +21,9 @@ FROM mcr.microsoft.com/playwright:v1.50.0-jammy
|
||||||
|
|
||||||
WORKDIR /app
|
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 built files and dependencies
|
||||||
COPY --from=builder /app/dist ./dist
|
COPY --from=builder /app/dist ./dist
|
||||||
COPY --from=builder /app/node_modules ./node_modules
|
COPY --from=builder /app/node_modules ./node_modules
|
||||||
|
|
@ -31,7 +34,8 @@ RUN mkdir -p output/logs output/screenshots
|
||||||
|
|
||||||
# Set environment
|
# Set environment
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV BOT_HEADLESS=true
|
ENV BOT_HEADLESS=false
|
||||||
|
ENV DISPLAY=:99
|
||||||
|
|
||||||
# Expose port
|
# Expose port
|
||||||
EXPOSE 4100
|
EXPOSE 4100
|
||||||
|
|
@ -40,5 +44,5 @@ EXPOSE 4100
|
||||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||||
CMD curl -f http://localhost:4100/health || exit 1
|
CMD curl -f http://localhost:4100/health || exit 1
|
||||||
|
|
||||||
# Run
|
# Start Xvfb in background, then run the bot
|
||||||
CMD ["node", "dist/index.js"]
|
CMD Xvfb :99 -screen 0 1280x720x24 -nolisten tcp & node dist/index.js
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,8 @@ services:
|
||||||
- PORT=4100
|
- PORT=4100
|
||||||
- GATEWAY_WS_URL=${GATEWAY_WS_URL:-wss://gateway-int.poweron-center.net/api/teamsbot/ws}
|
- GATEWAY_WS_URL=${GATEWAY_WS_URL:-wss://gateway-int.poweron-center.net/api/teamsbot/ws}
|
||||||
- BOT_NAME=${BOT_NAME:-PowerOn AI}
|
- BOT_NAME=${BOT_NAME:-PowerOn AI}
|
||||||
- BOT_HEADLESS=true
|
- BOT_HEADLESS=false
|
||||||
|
- DISPLAY=:99
|
||||||
- LOG_LEVEL=info
|
- LOG_LEVEL=info
|
||||||
- SCREENSHOT_ON_ERROR=true
|
- SCREENSHOT_ON_ERROR=true
|
||||||
volumes:
|
volumes:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue