Skip to content

Commit 64320ac

Browse files
committed
Merge branch 'develop'
2 parents e62a899 + 1a12ad9 commit 64320ac

File tree

3 files changed

+43
-32
lines changed

3 files changed

+43
-32
lines changed

Dockerfile

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM andrewholgate/drupal-php70:0.4.1
1+
FROM andrewholgate/drupal-php70:0.4.2
22
MAINTAINER Andrew Holgate <[email protected]>
33

44
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
@@ -8,43 +8,41 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
88
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install python-sphinx python-pip doxygen && \
99
DEBIAN_FRONTEND=noninteractive pip install sphinx_rtd_theme breathe
1010

11-
# XML needed by PHPCodeSniffer 2.3+ and other developer tools.
12-
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install php7.0-xml
11+
# XML needed by PHPCodeSniffer 2.3+
12+
# SQLite needed by Phan
13+
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install php7.0-xml php7.0-sqlite php-ast
1314

1415
# Install XDebug 2.4.0
15-
RUN wget https://github.com/xdebug/xdebug/archive/XDEBUG_2_4_0RC4.tar.gz && \
16-
tar zxvf XDEBUG_2_4_0RC4.tar.gz && \
17-
rm -f XDEBUG_2_4_0RC4.tar.gz && \
18-
cd xdebug-XDEBUG_2_4_0RC4 && \
16+
RUN wget https://github.com/xdebug/xdebug/archive/XDEBUG_2_4_0.tar.gz && \
17+
tar zxvf XDEBUG_2_4_0.tar.gz && \
18+
rm -f XDEBUG_2_4_0.tar.gz && \
19+
cd xdebug-XDEBUG_2_4_0 && \
1920
phpize && \
2021
./configure --enable-xdebug && \
2122
make && \
2223
cp modules/xdebug.so /usr/lib/php/20151012/ && \
23-
rm -Rf ../xdebug-XDEBUG_2_4_0RC4
24+
rm -Rf ../xdebug-XDEBUG_2_4_0
2425

2526
COPY xdebug.ini /etc/php/mods-available/xdebug.ini
2627
RUN ln -s /etc/php/mods-available/xdebug.ini /etc/php/7.0/fpm/conf.d/20-xdebug.ini
2728
COPY xdebug /usr/local/bin/xdebug
2829
RUN chmod +x /usr/local/bin/xdebug
2930

30-
# Symlink log files.
31-
RUN ln -s /var/log/xdebug/xdebug.log /var/www/log/
31+
# Symlink log files and create empty log file
32+
RUN ln -s /var/log/xdebug/xdebug.log /var/www/log/ && \
33+
mkdir /var/log/xdebug && \
34+
touch /var/log/xdebug/xdebug.log
3235

3336
# Install JRE (needed for some testing tools like sitespeed.io) and libs for PhantomJS.
3437
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install default-jre libfreetype6 libfontconfig
3538

36-
# Install Node 4.3.1 LTS
37-
RUN cd /opt && \
38-
wget https://nodejs.org/dist/v4.3.1/node-v4.3.1-linux-x64.tar.gz && \
39-
tar -xzf node-v4.3.1-linux-x64.tar.gz && \
40-
mv node-v4.3.1-linux-x64 node && \
41-
cd /usr/local/bin && \
42-
ln -s /opt/node/bin/* . && \
43-
rm -f /opt/node-v4.3.1-linux-x64.tar.gz
44-
39+
# Install Node 4.4.x LTS (https://nodejs.org/) via NVM
4540
USER ubuntu
46-
RUN echo 'export PATH="$PATH:$HOME/.npm-packages/bin"' >> ~/.bashrc && \
47-
npm config set prefix '~/.npm-packages'
41+
RUN wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash && \
42+
cp -f ~/.nvm/nvm.sh ~/.nvm/nvm-tmp.sh && \
43+
echo "nvm install 4.4; nvm alias default 4.4" >> ~/.nvm/nvm-tmp.sh && \
44+
sh ~/.nvm/nvm-tmp.sh && \
45+
rm ~/.nvm/nvm-tmp.sh
4846
USER root
4947

5048
# Setup for Wraith
@@ -56,9 +54,6 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -y install imagemagick && \
5654
/bin/bash -l -c "rvm rubygems current" && \
5755
/bin/bash -l -c "gem install wraith"
5856

59-
# Front-end tools
60-
RUN npm install -g phantomjs
61-
6257
# Install XHProf
6358
RUN wget https://github.com/RustJason/xhprof/archive/php7.tar.gz && \
6459
tar zxvf php7.tar.gz && \
@@ -72,6 +67,16 @@ RUN wget https://github.com/RustJason/xhprof/archive/php7.tar.gz && \
7267
# Tests fail:
7368
# make test && \
7469

70+
# Disable Google Pagespeed
71+
RUN sed -ri 's/\s*ModPagespeed on/ ModPagespeed off/g' /etc/apache2/mods-available/pagespeed.conf
72+
73+
# Local testing via BrowserStack automated tests
74+
RUN wget https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip && \
75+
unzip BrowserStackLocal-linux-x64.zip && \
76+
chmod a+x BrowserStackLocal && \
77+
mv BrowserStackLocal /usr/local/bin/ && \
78+
rm BrowserStackLocal-linux-x64.zip
79+
7580
# Turn on PHP error reporting
7681
RUN sed -ri 's/^display_errors\s*=\s*Off/display_errors = On/g' /etc/php/7.0/fpm/php.ini && \
7782
sed -ri 's/^display_errors\s*=\s*Off/display_errors = On/g' /etc/php/7.0/cli/php.ini && \
@@ -86,9 +91,6 @@ RUN sed -ri 's/^display_errors\s*=\s*Off/display_errors = On/g' /etc/php/7.0/fpm
8691
sed -ri 's/^zend.assertions\s*=\s*-1/zend.assertions = 1/g' /etc/php/7.0/fpm/php.ini && \
8792
sed -ri 's/^zend.assertions\s*=\s*-1/zend.assertions = 1/g' /etc/php/7.0/cli/php.ini
8893

89-
# Disable Google Pagespeed
90-
RUN sed -ri 's/\s*ModPagespeed on/ ModPagespeed off/g' /etc/apache2/mods-available/pagespeed.conf
91-
9294
# Grant ubuntu user access to sudo with no password.
9395
RUN apt-get -y install sudo && \
9496
echo "ubuntu ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@ Dockerised Drupal 8 development environment using PHP 7.0 on Ubuntu 14.04 with H
1010
## Front-end Tools
1111

1212
- [Wraith](https://github.com/BBC-News/wraith) - for visual regression testing.
13-
- [PhantomJS](http://phantomjs.org/) - for smoke tests.
13+
- [BrowserStackLocal](https://www.browserstack.com) - for automating browser tests locally (need a paid account).
1414

1515
## PHP Documentation Tools
1616

1717
- [DoxyGen](http://www.doxygen.org) - generate documentation from annotated PHP code. It is used to generate XML which is then interpreted by Sphinx.
1818
- [Sphinx](http://sphinx-doc.org/) - generate beautiful [Read The Docs](http://docs.readthedocs.org/en/latest/) format using [Breathe](https://breathe.readthedocs.org/) as a bridge to DoxyGen XML output.
1919

2020
# Other
21-
- [NodeJS](https://nodejs.org/) - Javascript runtime.
21+
- [NodeJS LTS](https://nodejs.org/) and [NVM (Node Version Manager)](https://github.com/creationix/nvm)
2222
- Java Runtime Environment (JRE) - project dev tools like [sitespeed.io](http://www.sitespeed.io/) need this.
2323

2424
# Installation
2525

2626
## Create Presistant Database data-only container
2727

2828
```bash
29-
# Build database image based off MySQL 5.6
30-
sudo docker run -d --name mysql-drupal-php70-dev mysql:5.6 --entrypoint /bin/echo MySQL data-only container for Drupal Dev MySQL
29+
# Build database image based off MySQL 5.7
30+
sudo docker run -d --name mysql-drupal-php70-dev mysql:5.7 --entrypoint /bin/echo MySQL data-only container for Drupal Dev MySQL
3131
```
3232

3333
## Build Project using Docker Compose
@@ -79,3 +79,12 @@ xdebug off
7979
xdebug on-all
8080
xdebug off-all
8181
```
82+
83+
## BrowserStack integration
84+
85+
Use [BrowserStack credentials](https://www.browserstack.com/accounts/settings) to get `{Access Key}`
86+
87+
```bash
88+
# Run BrowserStackLocal binary in background
89+
BrowserStackLocal {Access Key} </dev/null &>/dev/null &
90+
```

docker-compose.yml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ drupalphp70devweb:
66
links:
77
- drupalphp70devdb:database
88
drupalphp70devdb:
9-
image: mysql:5.6
9+
image: mysql:5.7
1010
volumes_from:
1111
- mysql-drupal-php70-dev
1212
environment:

0 commit comments

Comments
 (0)