2020-02-29 01:40:26 +03:00
|
|
|
FROM ubuntu:bionic
|
|
|
|
|
2020-12-08 21:36:37 +03:00
|
|
|
# === INSTALL Node.js ===
|
|
|
|
|
2021-06-18 02:14:10 +03:00
|
|
|
# Install node14
|
2020-12-08 21:36:37 +03:00
|
|
|
RUN apt-get update && apt-get install -y curl && \
|
2021-06-18 02:14:10 +03:00
|
|
|
curl -sL https://deb.nodesource.com/setup_14.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
|
|
|
|
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
|
2021-03-30 09:48:54 +03:00
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
2021-02-12 05:33:30 +03:00
|
|
|
|
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.
|
2020-09-03 00:42:01 +03:00
|
|
|
COPY ./playwright.tar.gz /tmp/playwright.tar.gz
|
2020-07-18 02:51:39 +03:00
|
|
|
|
|
|
|
# 2. Install playwright and then delete the installation.
|
2021-02-12 05:33:30 +03:00
|
|
|
# Browsers will remain 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-03-02 04:24:07 +03:00
|
|
|
mkdir /tmp/pw && cd /tmp/pw && npm init -y && \
|
|
|
|
npm i /tmp/playwright.tar.gz && \
|
2021-03-30 09:48:54 +03:00
|
|
|
DEBIAN_FRONTEND=noninteractive npx playwright install-deps && \
|
2021-03-02 04:24:07 +03:00
|
|
|
rm -rf /tmp/pw && rm /tmp/playwright.tar.gz && \
|
|
|
|
chmod -R 777 /ms-playwright
|