CoolFace
Apppublic

openenv/browsergym_env

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
Dockerfile69 linesDownload Raw Back to root
1# Use the matching Playwright Python image for browsergym-core 0.14.3.2FROM mcr.microsoft.com/playwright/python:v1.44.0-jammy3 4# Set working directory5WORKDIR /app/env6 7# Install only the extra packages this env still needs on top of the Playwright image.8RUN apt-get update && apt-get install -y --no-install-recommends \9    fonts-unifont \10    fonts-noto-color-emoji \11    git \12    curl \13    && rm -rf /var/lib/apt/lists/*14 15# Copy environment files first (for better caching)16# Build context should be envs/browsergym_env/ (not server/ or repo root)17COPY . .18 19# Make start script executable20RUN chmod +x /app/env/server/start.sh21 22RUN pip install --no-cache-dir uv23RUN uv pip install --system --no-cache .24 25# Ensure the installed Playwright package has a matching Chromium runtime.26ENV PLAYWRIGHT_BROWSERS_PATH=/usr/local/share/ms-playwright27RUN python -m playwright install chromium && chmod -R a+rx /usr/local/share/ms-playwright28 29# Install MiniWoB++ from a pinned snapshot to avoid flaky Hub-time git clones.30ARG MINIWOB_COMMIT=7fd85d71a4b60325c6585396ec4f48377d04983831RUN mkdir -p /usr/local/share/miniwob-plusplus && \32    curl -L "https://github.com/Farama-Foundation/miniwob-plusplus/archive/${MINIWOB_COMMIT}.tar.gz" \33    | tar -xz --strip-components=1 -C /usr/local/share/miniwob-plusplus && \34    chmod -R a+rX /usr/local/share/miniwob-plusplus35 36# Set environment variables37ENV PYTHONUNBUFFERED=138ENV BROWSERGYM_BENCHMARK=miniwob39ENV BROWSERGYM_TASK_NAME="click-test"40ENV BROWSERGYM_HEADLESS=true41ENV BROWSERGYM_VIEWPORT_WIDTH=128042ENV BROWSERGYM_VIEWPORT_HEIGHT=72043ENV BROWSERGYM_TIMEOUT=1000044ENV BROWSERGYM_PORT=800045ENV MINIWOB_HTML_DIR=/usr/local/share/miniwob-plusplus/miniwob/html46ENV MINIWOB_HTTP_PORT=888847ENV MINIWOB_URL=http://127.0.0.1:8888/miniwob/48ENV ENABLE_WEB_INTERFACE=true49 50# For WebArena tasks, these should be set by the user when running the container:51# ENV SHOPPING=52# ENV SHOPPING_ADMIN=53# ENV REDDIT=54# ENV GITLAB=55# ENV MAP=56# ENV WIKIPEDIA=57# ENV HOMEPAGE=58 59# Expose ports60EXPOSE 800061EXPOSE 888862 63# Health check64HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \65    CMD curl -f http://localhost:8000/health || exit 166 67# Run the server using the start script68CMD ["/app/env/server/start.sh"]69