-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
48 lines (44 loc) · 2.13 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
FROM cypress/browsers:chrome67
# Install deps + add Chrome Stable + purge all the things
# RUN apt-get update \&& apt-get install -y \
# apt-transport-https \
# ca-certificates \
# curl \
# gnupg \
# --no-install-recommends \
# && curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
# && echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list \
# && apt-get update && apt-get install -y \
# google-chrome-stable \
# --no-install-recommends \
# && rm -rf /var/lib/apt/lists/* \
# && ln -s /usr/bin/google-chrome-stable /usr/bin/chrome
# Fix the "W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages 404" error
RUN echo "deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list \
&& sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list \
&& apt-get -o Acquire::Check-Valid-Until=false update \
&& apt-get install -y \
#build-essential \
python \
python-dev \
unzip \
jq \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# Install aws-cli
RUN echo "Fetching awscli installer..." && curl -so "awscli-bundle.zip" "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" && \
echo "Unpacking..." && unzip awscli-bundle.zip > /dev/null && \
echo "Installing awscli..." && ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws > /dev/null && \
echo "Done" && rm -rf awscli-bundle awscli-bundle.zip
RUN groupadd -r chrome && useradd -r -g chrome -G audio,video chrome \
&& mkdir -p /home/chrome && chown -R chrome:chrome /home/chrome
RUN mkdir /app && chown chrome:chrome /app
USER chrome
WORKDIR /app
COPY --chown=chrome:chrome package.json package-lock.json ./
RUN npm install
RUN mkdir -p cypress/integration
COPY --chown=chrome:chrome cypress/integration/ cypress/integration/
COPY --chown=chrome:chrome cypress/fixtures/ cypress/fixtures/
COPY --chown=chrome:chrome docker-scripts/entrypoint.sh docker-scripts/cypress.json ./
ENTRYPOINT /app/entrypoint.sh