-
Notifications
You must be signed in to change notification settings - Fork 51
/
Dockerfile
192 lines (161 loc) · 6.71 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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
FROM ubuntu:bionic
MAINTAINER Chilio
ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN true
ENV DISPLAY :99
ENV SCREEN_RESOLUTION 1920x720x24
ENV CHROMEDRIVER_PORT 9515
ENV TMPDIR=/tmp
ENV XDEBUG_MODE coverage
RUN apt-get update && apt-get install -yq --fix-missing apt-utils netcat-openbsd
RUN apt-get update && apt-get install -yq --fix-missing language-pack-en-base
ENV LC_ALL=en_US.UTF-8
RUN apt-get update && apt-get install -yq --fix-missing openssl
RUN apt-get update && apt-get install -yq --fix-missing zip unzip
RUN apt-get update && apt-get install -yq --fix-missing software-properties-common curl
RUN add-apt-repository ppa:ondrej/php
RUN sed -i'' 's/archive\.ubuntu\.com/us\.archive\.ubuntu\.com/' /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade -yq
RUN apt-get update && apt-get install -yq --fix-missing libgd-tools
# Install PHP
RUN apt-get update && apt-get install -yq --fix-missing \
php7.2 \
php7.2-bcmath \
php7.2-bz2 \
php7.2-cli \
php7.2-common \
php7.2-curl \
php7.2-fpm \
php7.2-gd \
php7.2-gmp \
php7.2-imap \
php7.2-interbase \
php7.2-intl \
php7.2-json \
php7.2-ldap \
php7.2-mbstring \
php7.2-mysql \
php7.2-opcache \
php7.2-pgsql \
php7.2-phpdbg \
php7.2-pspell \
php7.2-readline \
php7.2-recode \
php7.2-snmp \
php7.2-soap \
php7.2-sqlite3 \
php7.2-sybase \
php7.2-tidy \
php7.2-xml \
php7.2-xmlrpc \
php7.2-zip \
php7.2-xsl \
php-geoip \
php-mongodb\
php-redis \
php-ssh2 \
php-uuid \
php-zmq \
php-radius \
php-http \
php-uploadprogress \
php-yaml \
php-memcached \
php-memcache \
php-tideways \
php-mailparse \
php-raphf \
php-stomp \
php-ds \
php-sass \
php-lua \
php-geos \
php-xdebug php-imagick imagemagick nginx
RUN update-alternatives --set php /usr/bin/php7.2
RUN update-alternatives --set phar /usr/bin/phar7.2
RUN update-alternatives --set phar.phar /usr/bin/phar.phar7.2
# RUN update-alternatives --set phpize /usr/bin/phpize7.2
# RUN update-alternatives --set php-config /usr/bin/php-config7.2
RUN apt-get update && apt-get install -yq --fix-missing mc lynx mysql-client bzip2 make g++
# Install Redis, Memcached, Beanstalk
RUN apt-get update && apt-get install -yq --fix-missing redis-server memcached beanstalkd
ENV COMPOSER_HOME /usr/local/share/composer
ENV COMPOSER_ALLOW_SUPERUSER 1
ENV PATH "$COMPOSER_HOME:$COMPOSER_HOME/vendor/bin:$PATH"
RUN \
mkdir -pv $COMPOSER_HOME && chmod -R g+w $COMPOSER_HOME \
&& curl -o /tmp/composer-setup.php https://getcomposer.org/installer \
&& curl -o /tmp/composer-setup.sig https://composer.github.io/installer.sig \
&& php -r "if (hash('SHA384', file_get_contents('/tmp/composer-setup.php')) \
!== trim(file_get_contents('/tmp/composer-setup.sig'))) { unlink('/tmp/composer-setup.php'); \
echo 'Invalid installer' . PHP_EOL; exit(1); }" \
&& php /tmp/composer-setup.php --filename=composer --install-dir=$COMPOSER_HOME
ADD commands/xvfb.init.sh /etc/init.d/xvfb
ADD commands/start-nginx-ci-project.sh /usr/bin/start-nginx-ci-project
RUN chmod +x /usr/bin/start-nginx-ci-project
ADD commands/versions /usr/bin/versions
RUN chmod +x /usr/bin/versions
ADD configs/.bowerrc /root/.bowerrc
ADD commands/configure-laravel.sh /usr/bin/configure-laravel
RUN chmod +x /usr/bin/configure-laravel
ADD commands/chrome-system-check.sh /usr/bin/chrome-system-check
RUN chmod +x /usr/bin/chrome-system-check
ADD commands/chromedriver-compatibility-matrix.php /usr/bin/chromedriver-compatibility-matrix.php
RUN chmod +x /usr/bin/chromedriver-compatibility-matrix.php
ADD commands/dusk-versions-check.php /usr/bin/dusk-versions-check.php
RUN chmod +x /usr/bin/dusk-versions-check.php
RUN \
apt-get install -yq --fix-missing xvfb gconf2 fonts-ipafont-gothic xfonts-cyrillic xfonts-100dpi xfonts-75dpi xfonts-base \
xfonts-scalable \
&& chmod +x /etc/init.d/xvfb \
&& CHROMEDRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE` \
&& mkdir -p /opt/chromedriver-$CHROMEDRIVER_VERSION \
&& curl -sS -o /tmp/chromedriver_linux64.zip \
http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip \
&& unzip -qq /tmp/chromedriver_linux64.zip -d /opt/chromedriver-$CHROMEDRIVER_VERSION \
&& rm /tmp/chromedriver_linux64.zip \
&& chmod +x /opt/chromedriver-$CHROMEDRIVER_VERSION/chromedriver \
&& ln -fs /opt/chromedriver-$CHROMEDRIVER_VERSION/chromedriver /usr/local/bin/chromedriver \
&& curl -sS -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 -yq update && apt-get install -yq --fix-missing google-chrome-stable x11vnc rsync
RUN apt-get update && apt-get install -yq --fix-missing apt-transport-https libpng-dev
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get update && apt-get install -yq --fix-missing nodejs
RUN apt-get update && apt-get install -yq --fix-missing git
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -yq --fix-missing yarn
RUN yarn global add bower --network-concurrency 1
RUN wget https://phar.phpunit.de/phpunit.phar
RUN chmod +x phpunit.phar
RUN mv phpunit.phar /usr/local/bin/phpunit
RUN npm install -g node-gyp
RUN npm install --unsafe-perm -g node-sass
RUN npm install -g gulp
RUN apt-get update && apt-get install -yq --fix-missing supervisor
ADD configs/supervisord.conf /etc/supervisor/supervisord.conf
ADD configs/nginx-default-site /etc/nginx/sites-available/default
RUN npm set progress=false
VOLUME [ "/var/log/supervisor" ]
# Clean system up
RUN apt-get -yq upgrade
RUN apt-get -yq autoremove
RUN apt-get -yq clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN systemctl enable xvfb
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="Laravel Dusk CI Docker" \
org.label-schema.description="Test suite for Laravel Dusk in gitlab CI" \
org.label-schema.url="https://hub.docker.com/r/chilio/laravel-dusk-ci/" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/chilio/laravel-dusk-ci" \
org.label-schema.vendor="Chilio" \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0.0"
CMD ["php-fpm7.2", "-F"]