forked from igorfor/docker-drupal-cli
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
119 lines (98 loc) · 3.55 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
FROM ubuntu:12.04
MAINTAINER Leonid Makarov <[email protected]>
# Set timezone aand locale.
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Prevent services autoload (http://jpetazzo.github.io/2013/10/06/policy-rc-d-do-not-start-services-automatically/)
RUN echo '#!/bin/sh\nexit 101' > /usr/sbin/policy-rc.d && chmod +x /usr/sbin/policy-rc.d
# Adding https://launchpad.net/~ondrej/+archive/ubuntu/php5 PPA repo for php5.6
RUN echo "deb http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu precise main " >> /etc/apt/sources.list
# Basic packages
RUN \
DEBIAN_FRONTEND=noninteractive apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes install \
supervisor \
curl \
wget \
zip \
unzip \
git \
mysql-client \
pv \
apt-transport-https \
vim \
patch \
ssh-client \
--no-install-recommends && \
# Cleanup
DEBIAN_FRONTEND=noninteractive apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# PHP packages
RUN \
DEBIAN_FRONTEND=noninteractive apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes install \
php5-common \
php5-cli \
php-pear \
php5-mysql \
php5-imagick \
php5-mcrypt \
php5-curl \
php5-gd \
php5-sqlite \
php5-json \
php5-memcache \
php5-intl \
php5-xdebug \
--no-install-recommends && \
# Cleanup
DEBIAN_FRONTEND=noninteractive apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Adding NodeJS repo (for up-to-date versions)
# This command is a stripped down version of "curl --silent --location https://deb.nodesource.com/setup_0.12 | bash -"
RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
echo 'deb https://deb.nodesource.com/node_0.12 precise main' > /etc/apt/sources.list.d/nodesource.list && \
echo 'deb-src https://deb.nodesource.com/node_0.12 precise main' >> /etc/apt/sources.list.d/nodesource.list
# Other language packages and dependencies
RUN \
DEBIAN_FRONTEND=noninteractive apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes install \
ruby1.9.1-full rlwrap nodejs \
--no-install-recommends && \
# Cleanup
DEBIAN_FRONTEND=noninteractive apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Bundler
RUN gem install bundler
# Grunt, Bower
RUN npm install -g grunt-cli bower
# Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Drush and Drupal Console
RUN composer global require drush/drush:8.1.2 && \
curl https://drupalconsole.com/installer -L -o drupal.phar && \
mv drupal.phar /usr/local/bin/drupal
# Install ahoy
RUN wget -q https://github.com/devinci-code/ahoy/releases/download/1.1.0/ahoy-`uname -s`-amd64 -O /usr/local/bin/ahoy && \
chmod +x /usr/local/bin/ahoy
# PHP settings changes
RUN sed -i 's/memory_limit = .*/memory_limit = 512M/' /etc/php5/cli/php.ini && \
sed -i 's/max_execution_time = .*/max_execution_time = 300/' /etc/php5/cli/php.ini
WORKDIR /var/www
# Add Composer bin directory to PATH
ENV PATH /root/.composer/vendor/bin:$PATH
# Home directory for bundle installs
ENV BUNDLE_PATH .bundler
# SSH settigns
COPY config/.ssh /root/.ssh
# Drush settings
COPY config/.drush /root/.drush
# Startup script
COPY ./startup.sh /opt/startup.sh
RUN chmod +x /opt/startup.sh
# Starter script
ENTRYPOINT ["/opt/startup.sh"]
# By default, launch supervisord to keep the container running.
CMD /usr/bin/supervisord -n