This repository was archived by the owner on Sep 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
90 lines (80 loc) · 2.36 KB
/
Dockerfile
File metadata and controls
90 lines (80 loc) · 2.36 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
FROM ubuntu:16.04
#
# BASE PACKAGES
#
RUN apt-get -qqy update \
&& apt-get -qqy --no-install-recommends install \
bzip2 \
ca-certificates \
unzip \
wget \
curl \
git \
jq \
zip \
xvfb \
pulseaudio \
dbus \
dbus-x11 \
build-essential && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/*
#
# NODEJS
#
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
apt-get update -qqy && apt-get -qqy install -y nodejs && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/*
#
# CHROME
#
ARG CHROME_VERSION="google-chrome-stable"
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list && \
apt-get update -qqy && apt-get -qqy install ${CHROME_VERSION:-google-chrome-stable} && \
rm /etc/apt/sources.list.d/google-chrome.list && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/* && \
ln -s /usr/bin/google-chrome /usr/bin/chromium-browser
#
# YARN
#
RUN wget -q -O - https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && \
apt-get update -qqy && apt-get -qqy install yarn && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/*
#
# INSTALL AND CONFIGURE
#
COPY docker-entrypoint.sh /opt/docker-entrypoint.sh
RUN chmod u+rx,g+rx,o+rx,a-w /opt/docker-entrypoint.sh && \
addgroup --gid 10777 worker && \
adduser --gecos "" --disabled-login --disabled-password --gid 10777 --uid 10777 worker && \
mkdir /work/ && \
mkdir /work-private/ && \
mkdir /work-bin/ && \
mkdir /data/ && \
mkdir /tmp/.X11-unix && \
chown -R root:root /tmp/.X11-unix && \
chmod 1777 /tmp/.X11-unix && \
chown -R worker:worker /work/ && \
chmod -R u+rwx,g+rwx,o-rwx /work/ && \
chown -R worker:worker /work-private/ && \
chown -R worker:worker /work-bin/ && \
chown -R worker:worker /data/ && \
chmod -R u+rwx,g+rwx,o-rwx /work-private/
#
# DBUS
#
COPY dbus-system.conf /work-bin/dbus-system.conf
RUN mkdir /var/run/dbus/ && \
chown -R worker:worker /var/run/dbus/
#
# RUN
#
USER worker
WORKDIR /work/
VOLUME ["/work"]
VOLUME ["/work-private"]
VOLUME ["/work-bin"]
VOLUME ["/data"]
ENTRYPOINT ["/opt/docker-entrypoint.sh"]
CMD ["yarn", "--version"]