forked from dimagi/commcare-hq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (47 loc) · 1.99 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM python:3.6-jessie
MAINTAINER Dimagi <devops@dimagi.com>
ENV PYTHONUNBUFFERED=1 \
PYTHONUSERBASE=/vendor \
PATH=/vendor/bin:$PATH \
NODE_VERSION=12.18.1
RUN mkdir /vendor
RUN curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz" \
&& tar -xzf "node-v$NODE_VERSION-linux-x64.tar.gz" -C /usr/local --strip-components=1 \
&& rm "node-v$NODE_VERSION-linux-x64.tar.gz"
# Install latest chrome dev package and fonts to support major
# charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others)
# Note: this installs the necessary libs to make the bundled version
# of Chromium that Puppeteer installs, work.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
openjdk-7-jdk \
wget \
libxml2-dev \
libxmlsec1-dev \
libxmlsec1-openssl \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst ttf-freefont \
--no-install-recommends \
# this line deletes all package sources, so don't apt-get install anything after this:
&& rm -rf /var/lib/apt/lists/* /src/*.deb
COPY requirements/test-requirements.txt package.json /vendor/
# prefer https for git checkouts made by pip
RUN git config --global url."https://".insteadOf git:// \
&& pip install --upgrade pip \
&& pip install -r /vendor/test-requirements.txt --user --upgrade \
&& rm -rf /root/.cache/pip
# this keeps the image size down, make sure to set in mocha-headless-chrome options
# executablePath: 'google-chrome-unstable'
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
RUN npm -g install \
yarn \
bower \
grunt-cli \
uglify-js \
puppeteer \
mocha-headless-chrome \
&& cd /vendor \
&& npm shrinkwrap \
&& yarn global add phantomjs-prebuilt