|
1 | | -FROM node:8.15 AS node |
| 1 | +# Build the node image and store the build as node. We need to name it because |
| 2 | +# when we call FROM again it will clear out the previous build. |
| 3 | +FROM node:14.17 AS node |
2 | 4 |
|
| 5 | +# Install gulp globally |
3 | 6 | RUN npm install -g gulp-cli |
4 | 7 |
|
5 | | -FROM php:7.2-cli |
| 8 | +# Build stage using php image. |
| 9 | +FROM php:7.4-cli |
6 | 10 |
|
7 | | -RUN apt-get update && apt-get install -y curl git rsync subversion openssl zip unzip zlib1g-dev libpng-dev \ |
8 | | - && echo "export PATH=~/.composer/vendor/bin:\$PATH" >> ~/.bash_profile \ |
| 11 | +# Install some needed packages then after install remove the cache files of |
| 12 | +# apt-get to save space. |
| 13 | +RUN apt-get update && apt-get install -y \ |
| 14 | + git \ |
| 15 | + libpng-dev \ |
| 16 | + rsync \ |
| 17 | + unzip \ |
| 18 | + zip \ |
| 19 | + zlib1g-dev \ |
| 20 | + libzip-dev \ |
9 | 21 | && rm -rf /var/lib/apt/lists/* |
10 | 22 |
|
| 23 | +# Create seperate config.ini files for overriding the php settings to set the |
| 24 | +# php memory limit to no limit (needed for composer) and set the timezone to |
| 25 | +# UTC if the PHP_TIMEZONE environment variable is undefined. |
| 26 | +# |
| 27 | +# This avoids having to have a php.ini file and will just use the defaults set |
| 28 | +# in php. |
11 | 29 | RUN echo "memory_limit=-1" > "$PHP_INI_DIR/conf.d/memory-limit.ini" \ |
12 | 30 | && echo "date.timezone=${PHP_TIMEZONE:-UTC}" > "$PHP_INI_DIR/conf.d/date_timezone.ini" |
13 | 31 |
|
| 32 | +# Install some needed php extensions (for composer?). |
14 | 33 | RUN docker-php-ext-install zip gd |
15 | 34 |
|
| 35 | +# Copy node.js from the node stage into the current stage as well will run our |
| 36 | +# builds in this stage. |
16 | 37 | COPY --from=node /usr/local/bin/node /usr/local/bin/node |
17 | 38 |
|
18 | | -ENV YARN_VERSION 1.12.3 |
| 39 | +# Set the yarn version environment version from the node stage. Yarn comes with |
| 40 | +# the node image by default so no reason to download it. |
| 41 | +ENV YARN_VERSION 1.22.5 |
19 | 42 |
|
| 43 | +# Copy yarn from the node stage to this stage. |
20 | 44 | COPY --from=node /opt/yarn-v$YARN_VERSION /opt/yarn |
21 | 45 |
|
| 46 | +# Copy the node modules from the node stage to this stage. |
22 | 47 | COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules |
23 | 48 |
|
| 49 | +# Symlink all of the needed node apps into our user bin so they can be |
| 50 | +# executable and update the apps permissions. |
24 | 51 | RUN cd /usr/local/bin; \ |
25 | | - ln -sf ../lib/node_modules/npm/bin/npm-cli.js npm; \ |
26 | | - ln -sf ../lib/node_modules/gulp-cli/bin/gulp.js gulp; \ |
27 | | - ln -sf /opt/yarn/bin/yarn yarn; \ |
28 | | - chmod +x npm; \ |
29 | | - chmod +x yarn; \ |
30 | | - chmod +x gulp |
| 52 | + ln -sf ../lib/node_modules/npm/bin/npm-cli.js npm; \ |
| 53 | + ln -sf ../lib/node_modules/gulp-cli/bin/gulp.js gulp; \ |
| 54 | + ln -sf /opt/yarn/bin/yarn yarn; \ |
| 55 | + chmod +x npm; \ |
| 56 | + chmod +x yarn; \ |
| 57 | + chmod +x gulp |
31 | 58 |
|
| 59 | +# Set some environment variables for composer and drush. |
32 | 60 | ENV COMPOSER_ALLOW_SUPERUSER 1 |
33 | | -ENV DRUSH_VERSION 8.1.15 |
| 61 | +ENV DRUSH_VERSION 10.4.3 |
34 | 62 | ENV TERMINUS_PLUGINS_DIR /usr/local/share/terminus-plugins |
35 | 63 |
|
| 64 | +# Copy our scripts folder into the tmp folder of this container. |
36 | 65 | COPY scripts /tmp/scripts/ |
37 | 66 |
|
| 67 | +<<<<<<< HEAD |
38 | 68 | RUN curl -sS https://getcomposer.org/installer | php -- --version=1.10.22 \ |
| 69 | +======= |
| 70 | +# Install composer and add it's vendor bin folder to the exports path in the |
| 71 | +# bash file so we can execute the apps from cmd line. |
| 72 | +RUN curl -sS https://getcomposer.org/installer | php -- --version=2.1.3 \ |
| 73 | +>>>>>>> 9.x |
39 | 74 | && mv composer.phar /usr/local/bin/composer \ |
40 | 75 | && echo "export PATH=~/.composer/vendor/bin:\$PATH" >> ~/.bash_profile |
41 | 76 |
|
42 | | - |
43 | | -# RUN php /tmp/scripts/composer-setup --install-dir=/usr/local/bin --filename=composer; rm -f /tmp/setup |
| 77 | +# Run the drush setup script that will install drush. |
44 | 78 | RUN /tmp/scripts/drush-setup |
| 79 | +# Run the terminus plugins setup script. |
45 | 80 | RUN /tmp/scripts/terminus-plugins-setup |
0 commit comments