Skip to content

Commit 8864010

Browse files
committed
Merge
2 parents 22e2a94 + db0b78a commit 8864010

3 files changed

Lines changed: 68 additions & 15 deletions

File tree

Dockerfile

Lines changed: 49 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,80 @@
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
24

5+
# Install gulp globally
36
RUN npm install -g gulp-cli
47

5-
FROM php:7.2-cli
8+
# Build stage using php image.
9+
FROM php:7.4-cli
610

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 \
921
&& rm -rf /var/lib/apt/lists/*
1022

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.
1129
RUN echo "memory_limit=-1" > "$PHP_INI_DIR/conf.d/memory-limit.ini" \
1230
&& echo "date.timezone=${PHP_TIMEZONE:-UTC}" > "$PHP_INI_DIR/conf.d/date_timezone.ini"
1331

32+
# Install some needed php extensions (for composer?).
1433
RUN docker-php-ext-install zip gd
1534

35+
# Copy node.js from the node stage into the current stage as well will run our
36+
# builds in this stage.
1637
COPY --from=node /usr/local/bin/node /usr/local/bin/node
1738

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
1942

43+
# Copy yarn from the node stage to this stage.
2044
COPY --from=node /opt/yarn-v$YARN_VERSION /opt/yarn
2145

46+
# Copy the node modules from the node stage to this stage.
2247
COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules
2348

49+
# Symlink all of the needed node apps into our user bin so they can be
50+
# executable and update the apps permissions.
2451
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
3158

59+
# Set some environment variables for composer and drush.
3260
ENV COMPOSER_ALLOW_SUPERUSER 1
33-
ENV DRUSH_VERSION 8.1.15
61+
ENV DRUSH_VERSION 10.4.3
3462
ENV TERMINUS_PLUGINS_DIR /usr/local/share/terminus-plugins
3563

64+
# Copy our scripts folder into the tmp folder of this container.
3665
COPY scripts /tmp/scripts/
3766

67+
<<<<<<< HEAD
3868
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
3974
&& mv composer.phar /usr/local/bin/composer \
4075
&& echo "export PATH=~/.composer/vendor/bin:\$PATH" >> ~/.bash_profile
4176

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.
4478
RUN /tmp/scripts/drush-setup
79+
# Run the terminus plugins setup script.
4580
RUN /tmp/scripts/terminus-plugins-setup

scripts/drush-setup

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
#!/bin/sh
22

3-
curl -L https://github.com/drush-ops/drush/releases/download/${DRUSH_VERSION}/drush.phar -o /usr/local/bin/drush
3+
mkdir -p /usr/local/share/drush
4+
/usr/bin/env composer -n --working-dir=/usr/local/share/drush require drush/drush:${DRUSH_VERSION}
5+
ln -fs /usr/local/share/drush/vendor/drush/drush/drush /usr/local/bin/drush
46
chmod +x /usr/local/bin/drush
7+
8+
# curl -L https://github.com/drush-ops/drush/releases/download/${DRUSH_VERSION}/drush.phar -o /usr/local/bin/drush
9+
# chmod +x /usr/local/bin/drush

scripts/terminus-plugins-setup

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/sh
22

33
COMPOSER_BIN_DIR=/usr/local/bin composer -n global require -n "hirak/prestissimo:^0.3"
4+
<<<<<<< HEAD
45
# Explicitly require symfony/process:^3 as a workaround until
56
# https://github.com/pantheon-systems/terminus/issues/1808 is available
67
# in a tagged release.
@@ -14,3 +15,15 @@ composer -n create-project -d $TERMINUS_PLUGINS_DIR pantheon-systems/terminus-qu
1415
composer -n create-project -d $TERMINUS_PLUGINS_DIR pantheon-systems/terminus-composer-plugin:^1
1516
composer -n create-project -d $TERMINUS_PLUGINS_DIR pantheon-systems/terminus-drupal-console-plugin:^1
1617
composer -n create-project -d $TERMINUS_PLUGINS_DIR pantheon-systems/terminus-mass-update:^1
18+
=======
19+
COMPOSER_BIN_DIR=/usr/local/bin composer -n --working-dir=/usr/local/share require pantheon-systems/terminus "^2.4"
20+
21+
mkdir -p $TERMINUS_PLUGINS_DIR
22+
composer -n create-project --no-dev -d $TERMINUS_PLUGINS_DIR pantheon-systems/terminus-build-tools-plugin:2.0.4
23+
composer -n create-project --no-dev -d $TERMINUS_PLUGINS_DIR pantheon-systems/terminus-secrets-plugin:^1.3
24+
composer -n create-project --no-dev -d $TERMINUS_PLUGINS_DIR pantheon-systems/terminus-rsync-plugin:^1.1
25+
composer -n create-project --no-dev -d $TERMINUS_PLUGINS_DIR pantheon-systems/terminus-quicksilver-plugin:^1.3
26+
composer -n create-project --no-dev -d $TERMINUS_PLUGINS_DIR pantheon-systems/terminus-composer-plugin:^1.1
27+
composer -n create-project --no-dev -d $TERMINUS_PLUGINS_DIR pantheon-systems/terminus-drupal-console-plugin:^1.1
28+
composer -n create-project --no-dev -d $TERMINUS_PLUGINS_DIR pantheon-systems/terminus-mass-update:^1.1
29+
>>>>>>> 9.x

0 commit comments

Comments
 (0)