lukas-worker / Dockerfile
yusef
Add xauth fix
ae1143c
# Lukas Worker - Docker Image for Hugging Face Spaces
# This runs the "Muscles" - Browser automation with live streaming
FROM node:20-slim
# Install system dependencies for Playwright/Chromium
RUN apt-get update && apt-get install -y \
wget \
gnupg \
ca-certificates \
fonts-liberation \
libasound2 \
libatk-bridge2.0-0 \
libatk1.0-0 \
libcups2 \
libdbus-1-3 \
libdrm2 \
libgbm1 \
libgtk-3-0 \
libnspr4 \
libnss3 \
libx11-xcb1 \
libxcomposite1 \
libxdamage1 \
libxfixes3 \
libxrandr2 \
xdg-utils \
xvfb \
xauth \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# Create app directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm install
# Install Playwright browsers
RUN npx playwright install chromium
# Copy app source
COPY . .
# Expose the port for Socket.io
EXPOSE 7860
# Set environment variables
ENV PORT=7860
ENV NODE_ENV=production
# Start the worker with Xvfb (virtual display)
CMD ["sh", "-c", "xvfb-run --server-args='-screen 0 1920x1080x24' node index.js"]