forked from andrewholgate/docker-drupal-php70-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
99 lines (82 loc) · 4.01 KB
/
Dockerfile
File metadata and controls
99 lines (82 loc) · 4.01 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
91
92
93
94
95
96
97
98
99
FROM andrewholgate/drupal-php70:0.3.0
MAINTAINER Andrew Holgate <andrewholgate@yahoo.com>
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y upgrade
# Install tools for documenting.
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install python-sphinx python-pip doxygen && \
DEBIAN_FRONTEND=noninteractive pip install sphinx_rtd_theme breathe
# Install XDebug 2.4.0 RC3
RUN wget https://github.com/xdebug/xdebug/archive/XDEBUG_2_4_0RC3.tar.gz && \
tar zxvf XDEBUG_2_4_0RC3.tar.gz && \
rm -f XDEBUG_2_4_0RC3.tar.gz && \
cd xdebug-XDEBUG_2_4_0RC3 && \
phpize && \
./configure --enable-xdebug && \
make && \
cp modules/xdebug.so /usr/lib/php/20151012/ && \
rm -Rf ../xdebug-XDEBUG_2_4_0RC3
COPY xdebug.ini /etc/php/mods-available/xdebug.ini
RUN ln -s /etc/php/mods-available/xdebug.ini /etc/php/7.0/cli/conf.d/20-xdebug.ini
RUN ln -s /etc/php/mods-available/xdebug.ini /etc/php/7.0/fpm/conf.d/20-xdebug.ini
# Symlink log files.
RUN ln -s /var/log/xdebug/xdebug.log /var/www/log/
# Install XHProf
#RUN wget https://github.com/phacility/xhprof/archive/master.tar.gz && \
# tar zxvf master.tar.gz && \
# rm -f master.tar.gz
# cd xhprof-master/extension/ && \
# phpize && \
# ./configure --with-php-config=/usr/bin/php-config7.0 && \
# make && \
# make install && \
# make test && \
# rm -Rf ../xhprof-master
# Install JRE (needed for some testing tools like sitespeed.io) and libs for PhantomJS.
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install default-jre libfreetype6 libfontconfig
# Install Node 4.2.4 LTS
RUN cd /opt && \
wget https://nodejs.org/dist/v4.2.4/node-v4.2.4-linux-x64.tar.gz && \
tar -xzf node-v4.2.4-linux-x64.tar.gz && \
mv node-v4.2.4-linux-x64 node && \
cd /usr/local/bin && \
ln -s /opt/node/bin/* . && \
rm -f /opt/node-v4.2.4-linux-x64.tar.gz
USER ubuntu
RUN echo 'export PATH="$PATH:$HOME/.npm-packages/bin"' >> ~/.bashrc && \
npm config set prefix '~/.npm-packages'
USER root
# Setup for Wraith
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install imagemagick && \
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 && \
\curl -sSL https://get.rvm.io | bash -s stable --ruby && \
/bin/bash -l -c "source /usr/local/rvm/scripts/rvm" && \
/bin/bash -l -c "rvm default" && \
/bin/bash -l -c "rvm rubygems current" && \
/bin/bash -l -c "gem install wraith"
# Front-end tools
RUN npm install -g phantomjs
# Turn on PHP error reporting
RUN sed -ri 's/^display_errors\s*=\s*Off/display_errors = On/g' /etc/php/7.0/fpm/php.ini && \
sed -ri 's/^display_errors\s*=\s*Off/display_errors = On/g' /etc/php/7.0/cli/php.ini && \
sed -ri 's/^error_reporting\s*=.*$/error_reporting = -1/g' /etc/php/7.0/fpm/php.ini && \
sed -ri 's/^error_reporting\s*=.*$/error_reporting = -1/g' /etc/php/7.0/cli/php.ini && \
sed -ri 's/^display_startup_errors\s*=\s*Off/display_startup_errors = On/g' /etc/php/7.0/fpm/php.ini && \
sed -ri 's/^display_startup_errors\s*=\s*Off/display_startup_errors = On/g' /etc/php/7.0/cli/php.ini && \
sed -ri 's/^track_errors\s*=\s*Off/track_errors = On/g' /etc/php/7.0/fpm/php.ini && \
sed -ri 's/^track_errors\s*=\s*Off/track_errors = On/g' /etc/php/7.0/cli/php.ini && \
sed -ri 's/^;xmlrpc_errors\s*=\s*0/xmlrpc_errors = 1/g' /etc/php/7.0/fpm/php.ini && \
sed -ri 's/^;xmlrpc_errors\s*=\s*0/xmlrpc_errors = 1/g' /etc/php/7.0/cli/php.ini
# Disable Google Pagespeed
RUN sed -ri 's/\s*ModPagespeed on/ ModPagespeed off/g' /etc/apache2/mods-available/pagespeed.conf
# Grant ubuntu user access to sudo with no password.
RUN apt-get -y install sudo && \
echo "ubuntu ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
usermod -a -G sudo ubuntu
# Clean-up installation.
RUN DEBIAN_FRONTEND=noninteractive apt-get -y autoclean && \
DEBIAN_FRONTEND=noninteractive apt-get -y autoremove
RUN service apache2 restart
RUN service php7.0-fpm start
# Expose additional ports for test tools.
EXPOSE 8080 9876 9000
CMD ["/usr/local/bin/run"]