2020-02-29 01:40:26 +03:00
|
|
|
################################################
|
|
|
|
# Compile with:
|
|
|
|
# sudo docker build -t microsoft/playwright:bionic -f Dockerfile.bionic .
|
|
|
|
#
|
|
|
|
# Run with:
|
|
|
|
# sudo docker run -d -p --rm --name playwright microsoft/playwright:bionic
|
|
|
|
#
|
|
|
|
#################################################
|
|
|
|
|
|
|
|
FROM ubuntu:bionic
|
|
|
|
|
|
|
|
# 1. Install node12
|
|
|
|
RUN apt-get update && apt-get install -y curl && \
|
|
|
|
curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
|
|
|
|
apt-get install -y nodejs
|
|
|
|
|
|
|
|
# 2. Install WebKit dependencies
|
2020-06-23 01:54:19 +03:00
|
|
|
RUN apt-get update && apt-get install -y libwoff1 \
|
|
|
|
libopus0 \
|
|
|
|
libwebp6 \
|
|
|
|
libwebpdemux2 \
|
|
|
|
libenchant1c2a \
|
|
|
|
libgudev-1.0-0 \
|
|
|
|
libsecret-1-0 \
|
|
|
|
libhyphen0 \
|
|
|
|
libgdk-pixbuf2.0-0 \
|
|
|
|
libegl1 \
|
|
|
|
libnotify4 \
|
|
|
|
libxslt1.1 \
|
|
|
|
libevent-2.1-6 \
|
|
|
|
libgles2 \
|
|
|
|
libvpx5
|
2020-02-29 01:40:26 +03:00
|
|
|
|
2020-06-19 04:12:00 +03:00
|
|
|
# 3. Install gstreamer and plugins to support video playback in WebKit.
|
2020-07-11 01:56:52 +03:00
|
|
|
RUN apt-get update && apt-get install -y libgstreamer-gl1.0-0 \
|
|
|
|
libgstreamer-plugins-bad1.0-0 \
|
|
|
|
gstreamer1.0-plugins-good
|
2020-06-19 04:12:00 +03:00
|
|
|
|
|
|
|
# 4. Install Chromium dependencies
|
2020-02-29 01:40:26 +03:00
|
|
|
|
2020-06-23 01:54:19 +03:00
|
|
|
RUN apt-get update && apt-get install -y libnss3 \
|
|
|
|
libxss1 \
|
|
|
|
libasound2 \
|
|
|
|
fonts-noto-color-emoji
|
2020-02-29 01:40:26 +03:00
|
|
|
|
2020-06-19 04:12:00 +03:00
|
|
|
# 5. Install Firefox dependencies
|
2020-02-29 01:40:26 +03:00
|
|
|
|
2020-06-23 01:54:19 +03:00
|
|
|
RUN apt-get update && apt-get install -y libdbus-glib-1-2 \
|
|
|
|
libxt6
|
2020-02-29 01:40:26 +03:00
|
|
|
|
2020-06-19 04:12:00 +03:00
|
|
|
# 6. Install ffmpeg to bring in audio and video codecs necessary for playing videos in Firefox.
|
2020-04-08 02:09:27 +03:00
|
|
|
|
2020-06-23 01:54:19 +03:00
|
|
|
RUN apt-get update && apt-get install -y ffmpeg
|
2020-04-08 02:09:27 +03:00
|
|
|
|
2020-06-19 04:12:00 +03:00
|
|
|
# 7. Add user so we don't need --no-sandbox in Chromium
|
2020-02-29 01:40:26 +03:00
|
|
|
RUN groupadd -r pwuser && useradd -r -g pwuser -G audio,video pwuser \
|
|
|
|
&& mkdir -p /home/pwuser/Downloads \
|
|
|
|
&& chown -R pwuser:pwuser /home/pwuser
|
|
|
|
|
2020-06-19 04:12:00 +03:00
|
|
|
# 8. (Optional) Install XVFB if there's a need to run browsers in headful mode
|
2020-06-23 01:54:19 +03:00
|
|
|
RUN apt-get update && apt-get install -y xvfb
|
2020-03-03 05:54:13 +03:00
|
|
|
|
2020-02-29 01:40:26 +03:00
|
|
|
# Run everything after as non-privileged user.
|
|
|
|
USER pwuser
|