Created
February 29, 2020 11:53
-
-
Save aleksandr-kotlyar/0bfb7888cbe413b8f06cfaa8066d2e3c to your computer and use it in GitHub Desktop.
python:3.7-alpine + chrome:3.11-alpine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.7-alpine | |
# install dependencies | |
USER root | |
COPY requirements.txt requirements.txt | |
RUN pip3 install --no-cache-dir -r requirements.txt | |
# Installs latest Chromium package. | |
RUN echo @edge http://mirrors.aliyun.com/alpine/v3.11/community > /etc/apk/repositories \ | |
&& echo @edge http://mirrors.aliyun.com/alpine/v3.11/main >> /etc/apk/repositories \ | |
&& apk add --no-cache \ | |
libstdc++@edge \ | |
chromium@edge \ | |
harfbuzz@edge \ | |
nss@edge \ | |
freetype@edge \ | |
ttf-freefont@edge \ | |
&& rm -rf /var/cache/* \ | |
&& mkdir /var/cache/apk | |
# Add Chrome as a user | |
RUN mkdir -p /usr/src/app \ | |
&& adduser -D chrome \ | |
&& chown -R chrome:chrome /usr/src/app | |
# Run Chrome as non-privileged | |
USER chrome | |
WORKDIR /usr/src/app | |
ENV CHROME_BIN=/usr/bin/chromium-browser \ | |
CHROME_PATH=/usr/lib/chromium/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment