-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
138 lines (115 loc) · 4.01 KB
/
Dockerfile
File metadata and controls
138 lines (115 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
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
FROM centos:7
# Install base packages.
RUN yum -y install epel-release centos-release-scl yum-plugin-ovl deltarpm && \
yum -y update && \
yum -y install sudo ssh curl less vim-minimal dnsutils openssl
RUN yum-config-manager --enable rhel-server-rhscl-7-rpms
# Download confd.
ENV CONFD_VERSION 0.11.0
RUN curl -L "https://github.com/kelseyhightower/confd/releases/download/v$CONFD_VERSION/confd-$CONFD_VERSION-linux-amd64" > /usr/bin/confd && \
chmod +x /usr/bin/confd
ENV CONFD_OPTS '--backend=env --onetime'
RUN yum -y install \
https://rpms.remirepo.net/enterprise/remi-release-7.rpm \
yum -y update
# Add the IUS repository. This is needed for git2.
RUN curl -L "https://centos7.iuscommunity.org/ius-release.rpm" > /usr/local/ius-release.rpm && \
rpm -Uvh /usr/local/ius-release.rpm
RUN yum -y install \
bzip2 \
gcc-c++ \
git2u-all \
httpd-tools \
jq \
make \
mariadb \
nmap-ncat \
patch \
php70 \
php70-php-devel \
php70-php-gd \
php70-php-xml \
php70-php-pdo \
php70-php-mysql \
php70-php-mysqlnd \
php70-php-mbstring \
php70-php-fpm \
php70-php-opcache \
php70-php-pecl-memcache \
php70-php-pecl-xdebug \
php70-php-mcrypt \
# There is no PHP 7 support for XHProf yet.
# php70-php-pecl-xhprof \
postgresql \
pv \
ruby193 \
ruby193-rubygems \
ruby193-ruby-devel \
sendmail \
unzip \
# Necessary for drush
which \
# Necessary library for phantomjs per https://github.com/ariya/phantomjs/issues/10904
fontconfig
# Ensure ruby193 binaries are in path
ENV PATH /root/.composer/vendor/bin:/opt/rh/ruby193/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Ensure PHP binaries are in path
RUN ln -sfv /opt/remi/php70/root/usr/bin/* /usr/bin/ && \
ln -sfv /opt/remi/php70/root/usr/sbin/* /usr/sbin/
# Install PHPRedis extension
ENV PHPREDIS_VERSION 3.1.2
RUN curl -L -o /tmp/phpredis.tar.gz "https://github.com/phpredis/phpredis/archive/$PHPREDIS_VERSION.tar.gz" && \
tar -xzf /tmp/phpredis.tar.gz -C /tmp && \
rm /tmp/phpredis.tar.gz && \
cd "/tmp/phpredis-$PHPREDIS_VERSION" && \
phpize && \
./configure && \
make && \
make install
# Enable other ruby193 SCL config
ENV LD_LIBRARY_PATH /opt/rh/ruby193/root/usr/lib64
ENV PKG_CONFIG_PATH /opt/rh/ruby193/root/usr/lib64/pkgconfig
# Ensure $HOME is set
ENV HOME /root
# Configure Git
# https://git-scm.com/docs/git-config#git-config-corepreloadIndex
RUN git config --global core.preloadindex true
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/bin/composer
# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
ENV COMPOSER_ALLOW_SUPERUSER 1
# Install Drush
RUN composer global require drush/drush:8.x
# Install Prestissimo for composer performance
RUN composer global require "hirak/prestissimo:^0.3"
# Update composer libraries
RUN composer global update
# Install nvm, supported node versions, and default cli modules.
ENV NVM_DIR $HOME/.nvm
ENV NODE_VERSION 4
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
RUN chmod +x $HOME/.nvm/nvm.sh
# Node 4.x (LTS)
RUN source $NVM_DIR/nvm.sh \
&& nvm install 4 \
&& npm install -g bower grunt-cli gulp-cli yo
# Node 5.x (stable)
RUN source $NVM_DIR/nvm.sh \
&& nvm install 5 \
&& npm install -g bower grunt-cli gulp-cli yo
# Node g.x (stable)
RUN source $NVM_DIR/nvm.sh \
&& nvm install 6 \
&& npm install -g bower grunt-cli gulp-cli yo
# Set the default version which can be overridden by ENV.
RUN source $NVM_DIR/nvm.sh \
&& nvm alias default $NODE_VERSION
RUN source $NVM_DIR/nvm.sh && nvm cache clear
COPY root /
# Install Drush commands
RUN drush pm-download -yv registry_rebuild-7.x --destination=/etc/drush/commands
# Run the s6-based init.
ENTRYPOINT ["/init"]
# Set up a standard volume for logs.
VOLUME ["/var/log/services"]
CMD [ "/versions.sh" ]