File size: 1,974 Bytes
2fd4aea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
844c5c8
f3f0fe2
2fd4aea
 
 
 
 
 
 
 
 
 
 
844c5c8
2fd4aea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
ARG BASE_IMAGE=ghcr.io/meta-pytorch/openenv-base:latest
FROM ghcr.io/meta-pytorch/openenv-base:latest

# Install system dependencies for Playwright and browsers
RUN apt-get update && apt-get install -y --no-install-recommends \
    # Playwright browser dependencies
    libnss3 \
    libnspr4 \
    libatk1.0-0 \
    libatk-bridge2.0-0 \
    libcups2 \
    libdrm2 \
    libdbus-1-3 \
    libxkbcommon0 \
    libatspi2.0-0 \
    libxcomposite1 \
    libxdamage1 \
    libxfixes3 \
    libxrandr2 \
    libgbm1 \
    libpango-1.0-0 \
    libcairo2 \
    libasound2 \
    libxshmfence1 \
    fonts-unifont \
    fonts-noto-color-emoji \
    # Additional dependencies
    git \
    wget \
    && rm -rf /var/lib/apt/lists/*

# Install BrowserGym and related packages
COPY src/envs/browsergym_env/server/requirements.txt /tmp/browsergym_requirements.txt
RUN pip install --no-cache-dir -r /tmp/browsergym_requirements.txt && \
    rm /tmp/browsergym_requirements.txt

# Install Playwright browsers (Chromium by default)
RUN playwright install chromium

# Copy OpenEnv core and browsergym_env code
WORKDIR /app
COPY src/core/ /app/src/core/
COPY src/envs/browsergym_env/ /app/src/envs/browsergym_env/
COPY src/envs/browsergym_env/README.md /app/README.md

# Set environment variables
ENV PYTHONPATH=/app/src
ENV PYTHONUNBUFFERED=1
ENV BROWSERGYM_BENCHMARK=miniwob
ENV BROWSERGYM_TASK_NAME=""
ENV BROWSERGYM_HEADLESS=true
ENV BROWSERGYM_VIEWPORT_WIDTH=1280
ENV BROWSERGYM_VIEWPORT_HEIGHT=720
ENV BROWSERGYM_TIMEOUT=10000

# For WebArena tasks, these should be set by the user when running the container:
# ENV SHOPPING=
# ENV SHOPPING_ADMIN=
# ENV REDDIT=
# ENV GITLAB=
# ENV MAP=
# ENV WIKIPEDIA=
# ENV HOMEPAGE=

EXPOSE 8000

HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
    CMD curl -f http://localhost:8000/health || exit 1

ENV ENABLE_WEB_INTERFACE=true

CMD ["uvicorn", "envs.browsergym_env.server.app:app", "--host", "0.0.0.0", "--port", "8000"]