|
1 | | -FROM alpine:3.7 |
| 1 | +# Based on buildpack-deps:jessie (as of Dec 2017). |
| 2 | +FROM node:8 |
2 | 3 |
|
3 | | -ENV NGINX_VERSION 1.12.2 |
4 | | -ENV PHP_VERSION 7.1.12 |
| 4 | +ENV NGINX_GPGKEY 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 |
| 5 | +ENV SURY_PHP_GPGKEY DF3D585DB8F0EB658690A554AC0E47584A7A714D |
5 | 6 |
|
6 | 7 | WORKDIR /root |
7 | 8 |
|
8 | | -# Install runtime dependencies. |
9 | | -RUN apk add --no-cache \ |
10 | | -# NGINX runtime dependencies. |
11 | | - pcre \ |
12 | | - zlib \ |
13 | | - openssl \ |
14 | | -# PHP runtime dependencies. |
15 | | - pcre \ |
16 | | - zlib \ |
17 | | - openssl \ |
18 | | - libcurl \ |
19 | | - libedit \ |
20 | | - libxml2 \ |
21 | | - libjpeg-turbo \ |
22 | | - libpng \ |
23 | | - libzip |
24 | | - |
25 | | -# Build stuff. |
26 | | -RUN apk add --no-cache --virtual .build-deps \ |
| 9 | +RUN apt-get update \ |
| 10 | + && apt-get install -y lsb-release ca-certificates apt-transport-https \ |
| 11 | + && apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys $NGINX_GPGKEY $SURY_PHP_GPGKEY \ |
| 12 | + && echo deb http://nginx.org/packages/debian/ $(lsb_release -sc) nginx >> /etc/apt/sources.list \ |
| 13 | + && echo deb https://packages.sury.org/php/ $(lsb_release -sc) main >> /etc/apt/sources.list \ |
| 14 | + && apt-get update \ |
| 15 | + && apt-get install --no-install-suggests --no-install-recommends -y \ |
| 16 | + # Human dependencies. |
| 17 | + less \ |
27 | 18 | curl \ |
28 | | - build-base \ |
29 | | -# NGINX build dependencies. |
30 | | - pcre-dev \ |
31 | | - zlib-dev \ |
32 | | - openssl-dev \ |
33 | | -# PHP build dependencies. |
34 | | - autoconf \ |
35 | | - pcre-dev \ |
36 | | - curl-dev \ |
37 | | - libedit-dev \ |
38 | | - libxml2-dev \ |
39 | | - openssl-dev \ |
40 | | - libjpeg-turbo-dev \ |
41 | | - libpng-dev \ |
42 | | - libzip-dev \ |
43 | | -# Build NGINX. |
44 | | - && curl -fL http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz | tar -xz \ |
45 | | - && cd nginx-$NGINX_VERSION \ |
46 | | - && ./configure \ |
47 | | - --prefix=/etc/nginx \ |
48 | | - --sbin-path=/usr/sbin/nginx \ |
49 | | - --modules-path=/usr/lib/nginx/modules \ |
50 | | - --conf-path=/etc/nginx/nginx.conf \ |
51 | | - --error-log-path=/var/log/nginx/error.log \ |
52 | | - --http-log-path=/var/log/nginx/access.log \ |
53 | | - --pid-path=/var/run/nginx.pid \ |
54 | | - --lock-path=/var/run/nginx.lock \ |
55 | | - --http-client-body-temp-path=/var/cache/nginx/client_temp \ |
56 | | - --http-proxy-temp-path=/var/cache/nginx/proxy_temp \ |
57 | | - --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \ |
58 | | - --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \ |
59 | | - --http-scgi-temp-path=/var/cache/nginx/scgi_temp \ |
60 | | - --with-http_ssl_module \ |
61 | | - && make \ |
62 | | - && make install \ |
63 | | - && cd .. \ |
64 | | - && rm -rf nginx-$NGINX_VERSION \ |
65 | | -# Build PHP. |
66 | | - && curl -fL https://php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror | tar -xj \ |
67 | | - && cd php-$PHP_VERSION \ |
68 | | - && ./configure \ |
69 | | - --prefix=/usr \ |
70 | | - --sysconfdir=/etc \ |
71 | | - --with-config-file-path=/etc/php \ |
72 | | - --with-config-file-scan-dir=/etc/php/conf.d \ |
73 | | - --disable-cgi \ |
74 | | - --enable-phpdbg=no \ |
75 | | - --enable-fpm \ |
76 | | - --enable-opcache \ |
77 | | - --enable-mbstring \ |
78 | | - --with-mysqli \ |
79 | | - --with-pdo-mysql \ |
80 | | - --enable-exif \ |
81 | | - --with-pcre-regex=/usr \ |
82 | | - --with-zlib \ |
83 | | - --with-openssl \ |
84 | | - --with-curl \ |
85 | | - --with-libedit \ |
86 | | - --with-gd \ |
87 | | - --with-jpeg-dir=/usr \ |
88 | | - --with-png-dir=/usr \ |
89 | | - --enable-zip \ |
90 | | - && make \ |
91 | | - && make install \ |
92 | | - && cd .. \ |
93 | | - && rm -rf php-$PHP_VERSION \ |
94 | | -# Build PHP extensions. |
95 | | - && pecl install xdebug \ |
96 | | -# Clean up. |
97 | | - && apk del .build-deps |
98 | | - |
99 | | -RUN apk add --no-cache \ |
100 | 19 | vim \ |
101 | | - curl \ |
102 | | - supervisor \ |
103 | | -# JavaScript workflow dependencies. |
104 | | - nodejs \ |
105 | | - nodejs-npm \ |
106 | | - yarn \ |
107 | | -# Drush runtime dependencies. |
| 20 | + # Drush dependencies. |
108 | 21 | mysql-client \ |
109 | | -# CircleCI dependencies. |
| 22 | + # CircleCI dependencies. |
110 | 23 | git \ |
111 | 24 | openssh-client \ |
112 | | - tar \ |
| 25 | + tar \ |
113 | 26 | gzip \ |
114 | | - ca-certificates |
| 27 | + ca-certificates \ |
| 28 | + # Cypress dependencies. |
| 29 | + libgtk2.0-0 \ |
| 30 | + libnotify-dev \ |
| 31 | + libgconf-2-4 \ |
| 32 | + libnss3 \ |
| 33 | + libxss1 \ |
| 34 | + libasound2 \ |
| 35 | + xvfb \ |
| 36 | + libxtst6 \ |
| 37 | + # Web server packages. |
| 38 | + supervisor \ |
| 39 | + nginx \ |
| 40 | + php7.1-fpm \ |
| 41 | + php7.1-cli \ |
| 42 | + php7.1-curl \ |
| 43 | + php7.1-json \ |
| 44 | + php7.1-gd \ |
| 45 | + php7.1-mbstring \ |
| 46 | + php7.1-mysql \ |
| 47 | + php7.1-opcache \ |
| 48 | + php7.1-readline \ |
| 49 | + php7.1-sqlite3 \ |
| 50 | + php7.1-xml \ |
| 51 | + php7.1-zip \ |
| 52 | + # TODO: Install Xdebug? |
| 53 | + && rm -rf /var/lib/apt/lists/* \ |
| 54 | + && apt-get purge -y --auto-remove |
115 | 55 |
|
116 | 56 | RUN curl -fL https://getcomposer.org/installer | php -- \ |
117 | 57 | --install-dir=/usr/local/bin \ |
118 | 58 | --filename=composer |
| 59 | +RUN composer global require --no-plugins --no-scripts \ |
| 60 | + drush/drush \ |
| 61 | + pantheon-systems/terminus |
119 | 62 |
|
120 | | -RUN adduser -D drupal |
121 | | - |
122 | | -RUN su drupal -c 'composer global require drush/drush' |
123 | | -RUN su drupal -c 'composer global require pantheon-systems/terminus' |
124 | | - |
125 | | -COPY root/etc/supervisord.conf /etc/ |
| 63 | +COPY supervisord.conf /etc/supervisor/supervisord.conf |
126 | 64 |
|
127 | | -RUN mkdir -p /var/cache/nginx \ |
128 | | - && mkdir -p /var/log/nginx \ |
129 | | - && chown drupal:drupal /var/cache/nginx /var/log/nginx \ |
130 | | - && ln -sf /dev/stdout /var/log/nginx/access.log \ |
| 65 | +RUN ln -sf /dev/stdout /var/log/nginx/access.log \ |
131 | 66 | && ln -sf /dev/stderr /var/log/nginx/error.log |
132 | | -COPY root/etc/nginx/nginx.conf /etc/nginx/ |
| 67 | +COPY nginx.conf /etc/nginx/nginx.conf |
133 | 68 |
|
134 | | -COPY root/etc/php/conf.d/*.ini /etc/php/conf.d/ |
135 | | -COPY root/etc/php-fpm.conf /etc/ |
| 69 | +COPY php-fpm.conf /etc/php/7.1/fpm/php-fpm.conf |
136 | 70 |
|
137 | 71 | RUN mkdir -p /projects/drupal/web |
138 | | -COPY root/projects/drupal/web/index.php /projects/drupal/web |
139 | | -RUN chown -R drupal:drupal /projects |
| 72 | +COPY index.php /projects/drupal/web/index.php |
140 | 73 |
|
141 | | -RUN mkdir -p /home/drupal/.drush |
142 | | -COPY root/home/drupal/.drush/drushrc.php /home/drupal/.drush/ |
143 | | -RUN chown -R drupal:drupal /home/drupal/.drush |
| 74 | +RUN mkdir -p /root/.drush |
| 75 | +COPY drushrc.php /root/.drush |
144 | 76 |
|
145 | | -COPY root/home/drupal/.my.cnf /home/drupal/ |
146 | | -RUN chown -R drupal:drupal /home/drupal/.my.cnf |
| 77 | +COPY dotmy.cnf /root/.my.cnf |
147 | 78 |
|
148 | | -USER drupal |
149 | | -ENV PATH="/home/drupal/.composer/vendor/bin:${PATH}" |
150 | | -ENV SIMPLETEST_BASE_URL="http://localhost:8080/" |
| 79 | +ENV PATH "/root/.composer/vendor/bin:${PATH}" |
| 80 | +ENV SIMPLETEST_BASE_URL http://localhost:8080/ |
151 | 81 | WORKDIR /projects |
152 | 82 |
|
153 | 83 | EXPOSE 8080 |
154 | | -CMD ["supervisord", "-n", "-c", "/etc/supervisord.conf"] |
| 84 | +CMD ["supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"] |
0 commit comments