2020-02-29 01:40:26 +03:00
|
|
|
FROM ubuntu:bionic
|
|
|
|
|
2021-10-20 02:10:24 +03:00
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
ARG TZ=America/Los_Angeles
|
|
|
|
|
2020-12-08 21:36:37 +03:00
|
|
|
# === INSTALL Node.js ===
|
|
|
|
|
2021-10-28 00:48:10 +03:00
|
|
|
# Install node16
|
2020-12-08 21:36:37 +03:00
|
|
|
RUN apt-get update && apt-get install -y curl && \
|
2021-10-28 00:48:10 +03:00
|
|
|
curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
|
2020-12-08 21:36:37 +03:00
|
|
|
apt-get install -y nodejs
|
|
|
|
|
|
|
|
# Feature-parity with node.js base images.
|
2020-09-02 02:43:20 +03:00
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends git ssh && \
|
2020-08-27 06:16:24 +03:00
|
|
|
npm install -g yarn
|
|
|
|
|
2020-12-08 21:36:37 +03:00
|
|
|
# Create the pwuser (we internally create a symlink for the pwuser and the root user)
|
2020-10-08 21:53:07 +03:00
|
|
|
RUN adduser pwuser
|
|
|
|
|
2021-01-27 19:51:51 +03:00
|
|
|
# Install Python 3.8
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y python3.8 python3-pip && \
|
|
|
|
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 && \
|
2021-03-22 22:29:54 +03:00
|
|
|
update-alternatives --install /usr/bin/python python /usr/bin/python3 1 && \
|
|
|
|
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
|
2021-01-27 19:51:51 +03:00
|
|
|
|
2021-10-20 02:10:24 +03:00
|
|
|
# Install VNC & noVNC
|
|
|
|
|
|
|
|
ARG NOVNC_REF="1.2.0"
|
|
|
|
ARG WEBSOCKIFY_REF="0.10.0"
|
|
|
|
|
|
|
|
RUN mkdir -p /opt/bin && chmod +x /dev/shm \
|
|
|
|
&& apt-get update && apt-get install -y unzip fluxbox x11vnc \
|
|
|
|
&& curl -L -o noVNC.zip "https://github.com/novnc/noVNC/archive/v${NOVNC_REF}.zip" \
|
|
|
|
&& unzip -x noVNC.zip \
|
|
|
|
&& mv noVNC-${NOVNC_REF} /opt/bin/noVNC \
|
|
|
|
&& cp /opt/bin/noVNC/vnc.html /opt/bin/noVNC/index.html \
|
|
|
|
&& rm noVNC.zip \
|
|
|
|
&& curl -L -o websockify.zip "https://github.com/novnc/websockify/archive/v${WEBSOCKIFY_REF}.zip" \
|
|
|
|
&& unzip -x websockify.zip \
|
|
|
|
&& rm websockify.zip \
|
|
|
|
&& mv websockify-${WEBSOCKIFY_REF} /opt/bin/noVNC/utils/websockify
|
|
|
|
|
2020-07-18 02:51:39 +03:00
|
|
|
# === BAKE BROWSERS INTO IMAGE ===
|
|
|
|
|
2021-02-12 05:33:30 +03:00
|
|
|
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
|
|
|
|
|
2020-07-18 02:51:39 +03:00
|
|
|
# 1. Add tip-of-tree Playwright package to install its browsers.
|
|
|
|
# The package should be built beforehand from tip-of-tree Playwright.
|
2021-10-11 17:52:17 +03:00
|
|
|
COPY ./playwright-core.tar.gz /tmp/playwright-core.tar.gz
|
2020-07-18 02:51:39 +03:00
|
|
|
|
2021-10-20 02:10:24 +03:00
|
|
|
# 2. Install playwright agent.
|
|
|
|
# Browsers will be downloaded in `/ms-playwright`.
|
2021-03-02 04:24:07 +03:00
|
|
|
# Note: make sure to set 777 to the registry so that any user can access
|
|
|
|
# registry.
|
2021-03-03 21:26:23 +03:00
|
|
|
RUN mkdir /ms-playwright && \
|
2021-10-20 02:10:24 +03:00
|
|
|
mkdir /ms-playwright-agent && \
|
|
|
|
cd /ms-playwright-agent && npm init -y && \
|
2021-10-11 17:52:17 +03:00
|
|
|
npm i /tmp/playwright-core.tar.gz && \
|
2021-10-20 02:10:24 +03:00
|
|
|
npx playwright install --with-deps && \
|
|
|
|
rm /tmp/playwright-core.tar.gz && \
|
2021-03-02 04:24:07 +03:00
|
|
|
chmod -R 777 /ms-playwright
|
2021-10-20 02:10:24 +03:00
|
|
|
|
|
|
|
COPY start_agent.sh /ms-playwright-agent/start_agent.sh
|