Skip to content

Commit

Permalink
Merge pull request #1 from nova-labs/webroot
Browse files Browse the repository at this point in the history
Drupal webroot committed to Git repo
  • Loading branch information
thaeli authored Feb 19, 2020
2 parents 6fe74d9 + 4cd0011 commit d9c2128
Show file tree
Hide file tree
Showing 15,768 changed files with 2,629,639 additions and 8,316 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ site/files/css/*
site/files/js/*
site/files/civicrm/upload/*
site/files/civicrm/persist/dyn/*
site/files/civicrm/persist/contribute/dyn/*
site/files/civicrm/persist/contribute/dyn/*
site/files/civicrm/ConfigAndLog/*
145 changes: 93 additions & 52 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,65 +1,106 @@
FROM drupal:7 as builder
# from https://www.drupal.org/docs/8/system-requirements/drupal-8-php-requirements
FROM php:7.3-apache-stretch AS base
# TODO switch to buster once https://github.com/docker-library/php/issues/865 is resolved in a clean way (either in the PHP image or in PHP itself)

# install the PHP extensions we need
RUN set -eux; \
\
if command -v a2enmod; then \
a2enmod rewrite; \
fi; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libfreetype6-dev \
libjpeg-dev \
libpng-dev \
libpq-dev \
libzip-dev \
zlib1g-dev \
libxml2-dev \
libcurl4-gnutls-dev \
; \
\
docker-php-ext-configure gd \
--with-freetype-dir=/usr \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
; \
\
docker-php-ext-install -j "$(nproc)" \
gd \
opcache \
pdo_mysql \
pdo_pgsql \
zip \
mysqli \
bcmath \
curl \
dom \
mbstring \
soap \
; \
\
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
| awk '/=>/ { print $3 }' \
| sort -u \
| xargs -r dpkg-query -S \
| cut -d: -f1 \
| sort -u \
| xargs -rt apt-mark manual; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*

# Download, build, and install the PhpRedis extension.
# We are specifying version 4.3.0 instead of version 5 - see issue at
# https://www.drupal.org/project/redis/issues/3074189
RUN set -eux; \
pear config-set temp_dir /root/tmp; \
echo '' | pecl install -o -f redis-4.3.0; \
rm -rf /root/tmp; \
docker-php-ext-enable redis;

# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
RUN { \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=60'; \
echo 'opcache.fast_shutdown=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

WORKDIR /var/www/html

FROM base AS cli
# Add various helpful tools for building/maintaining site
COPY drush8.phar /usr/local/bin/drush
COPY cv.phar /usr/local/bin/cv
COPY civix.phar /usr/local/bin/civix

RUN chmod +x /usr/local/bin/drush && \
chmod +x /usr/local/bin/cv && \
chmod +x /usr/local/bin/civix

ARG COMPOSER_AUTH
ENV COMPOSER_AUTH $COMPOSER_AUTH
ENV COMPOSER_CACHE_DIR=/tmp
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
mariadb-client \
redis-tools \
; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*

RUN apt-get update && apt-get install -y wget git unzip zlib1g-dev libxml2-dev libcurl4-gnutls-dev libzip-dev mariadb-client

RUN docker-php-ext-install mysqli bcmath curl dom mbstring zip soap && \
docker-php-ext-enable mysqli bcmath curl dom mbstring zip soap

# Download, build, and install the PhpRedis extension.
# We are specifying version 4.3.0 instead of version 5 - see issue at
# https://www.drupal.org/project/redis/issues/3074189
RUN pear config-set temp_dir /root/tmp && \
echo '' | pecl install -o -f redis-4.3.0 && \
rm -rf /root/tmp && \
docker-php-ext-enable redis

RUN wget -qO- https://download.civicrm.org/civicrm-5.22.0-drupal.tar.gz | tar xz -C /var/www/html/sites/all/modules
RUN drush dl ctools views webform rules webform_civicrm civicrm_entity entity options_element redis advanced_help

RUN wget -q -O /tmp/ext.zip https://lab.civicrm.org/extensions/mjwshared/-/archive/0.6/mjwshared-0.6.zip \
&& unzip /tmp/ext.zip -d /var/www/html/sites/all/modules/civicrm/ext/mjwshared \
&& rm /tmp/ext.zip \
&& wget -q -O /tmp/ext.zip https://lab.civicrm.org/extensions/stripe/-/archive/6.3.1/stripe-6.3.1.zip \
&& unzip /tmp/ext.zip -d /var/www/html/sites/all/modules/civicrm/ext/com.drastikbydesign.stripe \
&& rm /tmp/ext.zip \
&& wget -q -O /tmp/ext.zip https://github.com/adixon/ca.civicrm.logviewer/archive/1.2.zip \
&& unzip /tmp/ext.zip -d /var/www/html/sites/all/modules/civicrm/ext/ca.civicrm.logviewer \
&& rm /tmp/ext.zip \
&& wget -q -O /tmp/ext.zip https://github.com/civicrm/org.civicrm.volunteer/archive/22eb7ca6dbf99cddb6c43405a88f2cdf83ae7609.zip \
&& unzip /tmp/ext.zip -d /var/www/html/sites/all/modules/civicrm/ext/org.civicrm.volunteer \
&& rm /tmp/ext.zip \
&& wget -q -O /tmp/ext.zip https://github.com/civicrm/org.civicrm.contactlayout/archive/1.4.3.zip \
&& unzip /tmp/ext.zip -d /var/www/html/sites/all/modules/civicrm/ext/org.civicrm.contactlayout \
&& rm /tmp/ext.zip \
&& wget -q -O /tmp/ext.zip https://github.com/veda-consulting/uk.co.vedaconsulting.gdpr/archive/v2.8.zip \
&& unzip /tmp/ext.zip -d /var/www/html/sites/all/modules/civicrm/ext/uk.co.vedaconsulting.gdpr \
&& rm /tmp/ext.zip \
&& wget -q -O /tmp/ext.zip https://github.com/fuzionnz/nz.co.fuzion.transactional/archive/v1.0.3.zip \
&& unzip /tmp/ext.zip -d /var/www/html/sites/all/modules/civicrm/ext/nz.co.fuzion.transactional \
&& rm /tmp/ext.zip \
&& wget -q -O /tmp/ext.zip https://github.com/civicrm/org.civicrm.module.cividiscount/archive/3.8.1.zip \
&& unzip /tmp/ext.zip -d /var/www/html/sites/all/modules/civicrm/ext/org.civicrm.module.cividiscount \
&& rm /tmp/ext.zip \
&& wget -q -O /tmp/ext.zip https://lab.civicrm.org/extensions/civirules/-/archive/2.11/civirules-2.11.zip \
&& unzip /tmp/ext.zip -d /var/www/html/sites/all/modules/civicrm/ext/org.civicoop.civirules \
&& rm /tmp/ext.zip \
&& wget -q -O /tmp/ext.zip https://github.com/ginkgostreet/org.civicrm.angularprofiles/archive/v4.7.31-1.1.2.zip \
&& unzip /tmp/ext.zip -d /var/www/html/sites/all/modules/civicrm/ext/org.civicrm.angularprofiles \
&& rm /tmp/ext.zip
# Don't run the web server on the cli container!
CMD ["bash"]

# copy in our config files
COPY settings.php /var/www/html/sites/default
COPY civicrm.settings.php /var/www/html/sites/default
FROM base AS web
COPY --chown=www-data:www-data webroot/ /var/www/html
37 changes: 37 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
RUN wget -qO- https://download.civicrm.org/civicrm-5.22.0-drupal.tar.gz | tar xz -C /var/www/html/sites/all/modules
RUN drush dl ctools views webform rules webform_civicrm civicrm_entity entity options_element redis advanced_help

RUN wget -q -O /tmp/ext.zip https://lab.civicrm.org/extensions/mjwshared/-/archive/0.6/mjwshared-0.6.zip \
&& unzip /tmp/ext.zip -d /var/www/html/sites/all/modules/civicrm/ext/mjwshared \
&& rm /tmp/ext.zip \
&& wget -q -O /tmp/ext.zip https://lab.civicrm.org/extensions/stripe/-/archive/6.3.1/stripe-6.3.1.zip \
&& unzip /tmp/ext.zip -d /var/www/html/sites/all/modules/civicrm/ext/com.drastikbydesign.stripe \
&& rm /tmp/ext.zip \
&& wget -q -O /tmp/ext.zip https://github.com/adixon/ca.civicrm.logviewer/archive/1.2.zip \
&& unzip /tmp/ext.zip -d /var/www/html/sites/all/modules/civicrm/ext/ca.civicrm.logviewer \
&& rm /tmp/ext.zip \
&& wget -q -O /tmp/ext.zip https://github.com/civicrm/org.civicrm.volunteer/archive/22eb7ca6dbf99cddb6c43405a88f2cdf83ae7609.zip \
&& unzip /tmp/ext.zip -d /var/www/html/sites/all/modules/civicrm/ext/org.civicrm.volunteer \
&& rm /tmp/ext.zip \
&& wget -q -O /tmp/ext.zip https://github.com/civicrm/org.civicrm.contactlayout/archive/1.4.3.zip \
&& unzip /tmp/ext.zip -d /var/www/html/sites/all/modules/civicrm/ext/org.civicrm.contactlayout \
&& rm /tmp/ext.zip \
&& wget -q -O /tmp/ext.zip https://github.com/veda-consulting/uk.co.vedaconsulting.gdpr/archive/v2.8.zip \
&& unzip /tmp/ext.zip -d /var/www/html/sites/all/modules/civicrm/ext/uk.co.vedaconsulting.gdpr \
&& rm /tmp/ext.zip \
&& wget -q -O /tmp/ext.zip https://github.com/fuzionnz/nz.co.fuzion.transactional/archive/v1.0.3.zip \
&& unzip /tmp/ext.zip -d /var/www/html/sites/all/modules/civicrm/ext/nz.co.fuzion.transactional \
&& rm /tmp/ext.zip \
&& wget -q -O /tmp/ext.zip https://github.com/civicrm/org.civicrm.module.cividiscount/archive/3.8.1.zip \
&& unzip /tmp/ext.zip -d /var/www/html/sites/all/modules/civicrm/ext/org.civicrm.module.cividiscount \
&& rm /tmp/ext.zip \
&& wget -q -O /tmp/ext.zip https://lab.civicrm.org/extensions/civirules/-/archive/2.11/civirules-2.11.zip \
&& unzip /tmp/ext.zip -d /var/www/html/sites/all/modules/civicrm/ext/org.civicoop.civirules \
&& rm /tmp/ext.zip \
&& wget -q -O /tmp/ext.zip https://github.com/ginkgostreet/org.civicrm.angularprofiles/archive/v4.7.31-1.1.2.zip \
&& unzip /tmp/ext.zip -d /var/www/html/sites/all/modules/civicrm/ext/org.civicrm.angularprofiles \
&& rm /tmp/ext.zip

# copy in our config files
COPY settings.php /var/www/html/sites/default
COPY civicrm.settings.php /var/www/html/sites/default
31 changes: 26 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "3.3"
version: "3.7"
services:
db:
image: mariadb:10.4
Expand All @@ -18,18 +18,39 @@ services:
- "6379:6379"
web:
# image: docker.pkg.github.com/nova-labs/civicrm-docker/civicrm_web:dev
build: .
build:
context: .
target: web
ports:
- "80:80"
env_file:
- "env"
volumes:
- type: tmpfs
target: /tmp
- type: bind
source: "./webroot"
target: /var/www/html
read_only: true
- type: bind
source: "./site/files"
target: /var/www/html/sites/default/files
cli:
build:
context: .
target: cli
env_file:
- "env"
# force this container to stay running so we can exec into it
entrypoint: ""
command: "sleep infinity"
volumes:
- type: tmpfs
target: /tmp
- type: bind
source: "./webroot"
target: /var/www/html
- type: bind
source: "./civimaker"
target: /var/www/html/sites/all/modules/civicrm/ext/org.nova-labs.civimaker

source: "./site/files"
target: /var/www/html/sites/default/files
Loading

0 comments on commit d9c2128

Please sign in to comment.