2020-02-28 14:40:26 -08:00
|
|
|
FROM ubuntu:bionic
|
|
|
|
|
2021-10-19 16:10:24 -07:00
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
ARG TZ=America/Los_Angeles
|
|
|
|
|
2020-12-08 10:36:37 -08:00
|
|
|
# === INSTALL Node.js ===
|
|
|
|
|
2021-11-11 15:35:57 -08:00
|
|
|
RUN apt-get update && \
|
|
|
|
# Install node16
|
2021-11-30 19:35:48 +01:00
|
|
|
apt-get install -y curl wget && \
|
2021-10-27 23:48:10 +02:00
|
|
|
curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
|
2021-11-11 15:35:57 -08:00
|
|
|
apt-get install -y nodejs && \
|
2020-12-08 10:36:37 -08:00
|
|
|
|
2021-11-11 15:35:57 -08:00
|
|
|
# Feature-parity with node.js base images.
|
|
|
|
apt-get install -y --no-install-recommends git openssh-client && \
|
|
|
|
npm install -g yarn && \
|
2020-08-26 20:16:24 -07:00
|
|
|
|
2021-11-11 15:35:57 -08:00
|
|
|
# Install Python 3.8
|
|
|
|
apt-get install -y python3.8 python3-pip && \
|
2021-01-27 08:51:51 -08:00
|
|
|
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 && \
|
2021-03-22 15:29:54 -04:00
|
|
|
update-alternatives --install /usr/bin/python python /usr/bin/python3 1 && \
|
2021-11-11 15:35:57 -08:00
|
|
|
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1 && \
|
2021-01-27 08:51:51 -08:00
|
|
|
|
2021-11-11 15:35:57 -08:00
|
|
|
# clean apt cache
|
|
|
|
rm -rf /var/lib/apt/lists/* && \
|
2021-10-19 16:10:24 -07:00
|
|
|
|
2021-11-11 15:35:57 -08:00
|
|
|
# Create the pwuser (we internally create a symlink for the pwuser and the root user)
|
|
|
|
adduser pwuser
|
2021-10-19 16:10:24 -07:00
|
|
|
|
2020-07-17 16:51:39 -07:00
|
|
|
# === BAKE BROWSERS INTO IMAGE ===
|
|
|
|
|
2021-02-11 18:33:30 -08:00
|
|
|
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
|
|
|
|
|
2020-07-17 16:51:39 -07: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 10:52:17 -04:00
|
|
|
COPY ./playwright-core.tar.gz /tmp/playwright-core.tar.gz
|
2020-07-17 16:51:39 -07:00
|
|
|
|
2021-11-11 15:35:57 -08:00
|
|
|
# 2. Bake in browsers & deps.
|
2021-10-19 16:10:24 -07:00
|
|
|
# Browsers will be downloaded in `/ms-playwright`.
|
2021-03-01 17:24:07 -08:00
|
|
|
# Note: make sure to set 777 to the registry so that any user can access
|
|
|
|
# registry.
|
2021-03-03 10:26:23 -08:00
|
|
|
RUN mkdir /ms-playwright && \
|
2021-10-19 16:10:24 -07:00
|
|
|
mkdir /ms-playwright-agent && \
|
|
|
|
cd /ms-playwright-agent && npm init -y && \
|
2021-10-11 10:52:17 -04:00
|
|
|
npm i /tmp/playwright-core.tar.gz && \
|
2021-11-11 15:35:57 -08:00
|
|
|
npx playwright install --with-deps && rm -rf /var/lib/apt/lists/* && \
|
2021-10-19 16:10:24 -07:00
|
|
|
rm /tmp/playwright-core.tar.gz && \
|
2021-11-11 15:35:57 -08:00
|
|
|
rm -rf /ms-playwright-agent && \
|
2021-03-01 17:24:07 -08:00
|
|
|
chmod -R 777 /ms-playwright
|