kyle8581 commited on
Commit
8295f33
·
1 Parent(s): d4476af

updated docker

Browse files
Files changed (1) hide show
  1. Dockerfile +94 -12
Dockerfile CHANGED
@@ -1,17 +1,99 @@
1
- FROM mcr.microsoft.com/playwright:v1.50.0-noble
2
 
3
- WORKDIR /code
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
- #COPY package.json ./package.json
 
 
 
6
 
7
- RUN npm i [email protected]
8
- RUN npm i web-locks
9
- RUN npm i ws
10
- RUN npm i user-agents
11
- RUN npm i uuid
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  COPY . .
14
- RUN apt-get update && apt-get install -y python3-pip
15
- RUN python3 -m pip install -e BrowserGym/
16
- RUN playwright install
17
- CMD [ "node", "index.mjs" ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
 
3
+ # Install system dependencies
4
+ RUN apt-get update && apt-get install -y \
5
+ wget \
6
+ gnupg \
7
+ curl \
8
+ unzip \
9
+ xvfb \
10
+ libgconf-2-4 \
11
+ libxss1 \
12
+ libnss3 \
13
+ libnspr4 \
14
+ libasound2 \
15
+ libatk1.0-0 \
16
+ libatk-bridge2.0-0 \
17
+ libcups2 \
18
+ libdbus-1-3 \
19
+ libdrm2 \
20
+ libgbm1 \
21
+ libgtk-3-0 \
22
+ libxcomposite1 \
23
+ libxdamage1 \
24
+ libxfixes3 \
25
+ libxrandr2 \
26
+ xdg-utils \
27
+ fonts-liberation \
28
+ dbus \
29
+ xauth \
30
+ xvfb \
31
+ x11vnc \
32
+ tigervnc-tools \
33
+ supervisor \
34
+ net-tools \
35
+ procps \
36
+ git \
37
+ python3-numpy \
38
+ fontconfig \
39
+ fonts-dejavu \
40
+ fonts-dejavu-core \
41
+ fonts-dejavu-extra \
42
+ nodejs \
43
+ npm \
44
+ && apt-get update --fix-missing \
45
+ && rm -rf /var/lib/apt/lists/*
46
 
47
+ # Install noVNC
48
+ RUN git clone https://github.com/novnc/noVNC.git /opt/novnc \
49
+ && git clone https://github.com/novnc/websockify /opt/novnc/utils/websockify \
50
+ && ln -s /opt/novnc/vnc.html /opt/novnc/index.html
51
 
52
+ # Install Chrome
53
+ RUN curl -fsSL https://dl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /usr/share/keyrings/google-chrome.gpg \
54
+ && echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-chrome.gpg] http://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google-chrome.list
 
 
55
 
56
+ # Set up working directory
57
+ WORKDIR /app
58
+
59
+ # Copy requirements and install Python dependencies
60
+ COPY requirements.txt .
61
+ RUN pip install --no-cache-dir -r requirements.txt
62
+
63
+ # Clone and install BrowserGym from GitHub
64
+ # RUN git clone https://github.com/browser-gym/browsergym.git BrowserGym
65
+ COPY BrowserGym/ BrowserGym/
66
+ RUN cd BrowserGym && make install-demo
67
+
68
+
69
+ # Install Playwright through pip first
70
+ RUN pip install playwright
71
+ # RUN playwright install --with-deps chromium
72
+ # RUN playwright install-deps
73
+
74
+ # Install Chrome
75
+ RUN apt-get update --fix-missing && apt-get install -y google-chrome-stable
76
+
77
+ # Copy the application code
78
  COPY . .
79
+
80
+ # Set environment variables
81
+ ENV PYTHONUNBUFFERED=1
82
+ ENV BROWSER_USE_LOGGING_LEVEL=info
83
+ ENV CHROME_PATH=/usr/bin/google-chrome
84
+ ENV ANONYMIZED_TELEMETRY=false
85
+ ENV DISPLAY=:99
86
+ ENV RESOLUTION=1920x1080x24
87
+ ENV VNC_PASSWORD=vncpassword
88
+ ENV CHROME_PERSISTENT_SESSION=true
89
+ ENV RESOLUTION_WIDTH=1920
90
+ ENV RESOLUTION_HEIGHT=1080
91
+
92
+ # Set up supervisor configuration
93
+ # RUN mkdir -p /var/log/supervisor
94
+ # COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
95
+
96
+ # EXPOSE 7788 6080 5900
97
+
98
+ # CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
99
+ RUN python3 app.py