Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused dependencies #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 61 additions & 30 deletions apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,60 @@ FROM php:7.1-apache
LABEL vendor="Mautic"
LABEL maintainer="Luiz Eduardo Oliveira Fonseca <[email protected]>"

# Install PHP extensions
RUN apt-get update && apt-get install --no-install-recommends -y \
cron \
git \
wget \
sudo \
libc-client-dev \
libicu-dev \
libkrb5-dev \
libmcrypt-dev \
libssl-dev \
libz-dev \
unzip \
zip \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists/* \
&& rm /etc/cron.daily/*
# runtime dependencies
RUN set -ex; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
busybox-static \
; \
rm -rf /var/lib/apt/lists/*; \
\
mkdir -p /var/spool/cron/crontabs

RUN docker-php-ext-configure imap --with-imap --with-imap-ssl --with-kerberos \
&& docker-php-ext-configure opcache --enable-opcache \
&& docker-php-ext-install imap intl mbstring mcrypt mysqli pdo_mysql zip opcache bcmath\
&& docker-php-ext-enable imap intl mbstring mcrypt mysqli pdo_mysql zip opcache bcmath
# Install PHP extensions
RUN set -ex; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libc-client-dev \
libfreetype6-dev \
libicu-dev \
libjpeg62-turbo-dev \
libkrb5-dev \
libmcrypt-dev \
libpng-dev \
libssl-dev \
; \
\
docker-php-ext-configure gd --with-freetype --with-jpeg; \
docker-php-ext-configure imap --with-imap --with-imap-ssl --with-kerberos; \
docker-php-ext-install -j "$(nproc)" \
bcmath \
imap \
intl \
mcrypt \
mysqli \
opcache \
pdo_mysql \
zip \
; \
\
# 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/*

# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
Expand All @@ -50,25 +82,24 @@ ENV PHP_INI_DATE_TIMEZONE='UTC' \
PHP_MAX_EXECUTION_TIME=300

# Download package and extract to web volume
RUN curl -o mautic.zip -SL https://github.com/mautic/mautic/releases/download/${MAUTIC_VERSION}/${MAUTIC_VERSION}.zip \
&& echo "$MAUTIC_SHA1 *mautic.zip" | sha1sum -c - \
&& mkdir /usr/src/mautic \
&& unzip mautic.zip -d /usr/src/mautic \
&& rm mautic.zip \
&& chown -R www-data:www-data /usr/src/mautic
RUN set -ex; \
curl -o mautic.zip -fsSL https://github.com/mautic/mautic/releases/download/${MAUTIC_VERSION}/${MAUTIC_VERSION}.zip; \
echo "$MAUTIC_SHA1 *mautic.zip" | sha1sum -c -; \
mkdir /usr/src/mautic; \
busybox unzip mautic.zip -qd /usr/src/mautic; \
rm mautic.zip; \
chown -R www-data:www-data /usr/src/mautic

# Copy init scripts and custom .htaccess
COPY docker-entrypoint.sh /entrypoint.sh
COPY makeconfig.php /makeconfig.php
COPY makedb.php /makedb.php
COPY mautic.crontab /etc/cron.d/mautic
RUN chmod 644 /etc/cron.d/mautic
COPY mautic.crontab /var/spool/cron/crontabs/www-data

# Enable Apache Rewrite Module
RUN a2enmod rewrite

# Apply necessary permissions
RUN ["chmod", "+x", "/entrypoint.sh"]
ENTRYPOINT ["/entrypoint.sh"]

CMD ["apache2-foreground"]
26 changes: 13 additions & 13 deletions apache/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,42 +48,42 @@ fi
#ENABLES HUBSPOT CRON
if [ -n "$MAUTIC_CRON_HUBSPOT" ]; then
echo >&2 "CRON: Activating Hubspot"
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:fetchleads --integration=Hubspot > /var/log/cron.pipe 2>&1" >> /etc/cron.d/mautic
echo "15,45 * * * * www-data php /var/www/html/app/console mautic:integration:pushactivity --integration=Hubspot > /var/log/cron.pipe 2>&1" >> /etc/cron.d/mautic
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:fetchleads --integration=Hubspot > /var/log/cron.pipe 2>&1" >> /var/spool/cron/crontabs/www-data
echo "15,45 * * * * www-data php /var/www/html/app/console mautic:integration:pushactivity --integration=Hubspot > /var/log/cron.pipe 2>&1" >> /var/spool/cron/crontabs/www-data
fi

#ENABLES SALESFORCE CRON
if [ -n "$MAUTIC_CRON_SALESFORCE" ]; then
echo >&2 "CRON: Activating Salesforce"
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:fetchleads --integration=Salesforce > /var/log/cron.pipe 2>&1" >> /etc/cron.d/mautic
echo "12,42 * * * * www-data php /var/www/html/app/console mautic:integration:pushactivity --integration=Salesforce > /var/log/cron.pipe 2>&1" >> /etc/cron.d/mautic
echo "14,44 * * * * www-data php /var/www/html/app/console mautic:integration:pushleadactivity --integration=Salesforce > /var/log/cron.pipe 2>&1" >> /etc/cron.d/mautic
echo "16,46 * * * * www-data php /var/www/html/app/console mautic:integration:synccontacts --integration=Salesforce > /var/log/cron.pipe 2>&1" >> /etc/cron.d/mautic
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:fetchleads --integration=Salesforce > /var/log/cron.pipe 2>&1" >> /var/spool/cron/crontabs/www-data
echo "12,42 * * * * www-data php /var/www/html/app/console mautic:integration:pushactivity --integration=Salesforce > /var/log/cron.pipe 2>&1" >> /var/spool/cron/crontabs/www-data
echo "14,44 * * * * www-data php /var/www/html/app/console mautic:integration:pushleadactivity --integration=Salesforce > /var/log/cron.pipe 2>&1" >> /var/spool/cron/crontabs/www-data
echo "16,46 * * * * www-data php /var/www/html/app/console mautic:integration:synccontacts --integration=Salesforce > /var/log/cron.pipe 2>&1" >> /var/spool/cron/crontabs/www-data
fi

#ENABLES SUGARCRM CRON
if [ -n "$MAUTIC_CRON_SUGARCRM" ]; then
echo >&2 "CRON: Activating SugarCRM"
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:fetchleads --fetch-all --integration=Sugarcrm > /var/log/cron.pipe 2>&1" >> /etc/cron.d/mautic
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:fetchleads --fetch-all --integration=Sugarcrm > /var/log/cron.pipe 2>&1" >> /var/spool/cron/crontabs/www-data
fi

#ENABLES PIPEDRIVE CRON
if [ -n "$MAUTIC_CRON_PIPEDRIVE" ]; then
echo >&2 "CRON: Activating Pipedrive"
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:pipedrive:fetch > /var/log/cron.pipe 2>&1" >> /etc/cron.d/mautic
echo "15,45 * * * * www-data php /var/www/html/app/console mautic:integration:pipedrive:push > /var/log/cron.pipe 2>&1" >> /etc/cron.d/mautic
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:pipedrive:fetch > /var/log/cron.pipe 2>&1" >> /var/spool/cron/crontabs/www-data
echo "15,45 * * * * www-data php /var/www/html/app/console mautic:integration:pipedrive:push > /var/log/cron.pipe 2>&1" >> /var/spool/cron/crontabs/www-data
fi

#ENABLES ZOHO CRON
if [ -n "$MAUTIC_CRON_ZOHO" ]; then
echo >&2 "CRON: Activating ZohoCRM"
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:fetchleads --integration=Zoho > /var/log/cron.pipe 2>&1" >> /etc/cron.d/mautic
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:fetchleads --integration=Zoho > /var/log/cron.pipe 2>&1" >> /var/spool/cron/crontabs/www-data
fi

#ENABLES DYNAMICS CRON
if [ -n "$MAUTIC_CRON_DYNAMICS" ]; then
echo >&2 "CRON: Activating DynamicsCRM"
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:fetchleads -i Dynamics > /var/log/cron.pipe 2>&1" >> /etc/cron.d/mautic
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:fetchleads -i Dynamics > /var/log/cron.pipe 2>&1" >> /var/spool/cron/crontabs/www-data
fi

if ! [ -e index.php -a -e app/AppKernel.php ]; then
Expand Down Expand Up @@ -128,7 +128,7 @@ if [[ "$MAUTIC_RUN_CRON_JOBS" == "true" ]]; then
fi
(tail -f /var/log/cron.pipe | while read line; do echo "[CRON] $line"; done) &
CRONLOGPID=$!
cron -f &
busybox crond -f &
CRONPID=$!
else
echo >&2 "Not running cron as requested."
Expand All @@ -141,7 +141,7 @@ echo >&2 "======================================================================
# Github Pull Tester
if [ -n "$MAUTIC_TESTER" ]; then
echo >&2 "Copying Mautic Github Pull Tester"
wget https://raw.githubusercontent.com/mautic/mautic-tester/master/tester.php
curl -fsSOL https://raw.githubusercontent.com/mautic/mautic-tester/master/tester.php
fi


Expand Down
88 changes: 59 additions & 29 deletions beta-apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,58 @@ FROM php:7.2-apache
LABEL vendor="Mautic"
LABEL maintainer="Luiz Eduardo Oliveira Fonseca <[email protected]>"

# Install PHP extensions
RUN apt-get update && apt-get install --no-install-recommends -y \
cron \
git \
wget \
sudo \
libc-client-dev \
libicu-dev \
libkrb5-dev \
libssl-dev \
libz-dev \
unzip \
zip \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists/* \
&& rm /etc/cron.daily/*
# runtime dependencies
RUN set -ex; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
busybox-static \
; \
rm -rf /var/lib/apt/lists/*; \
\
mkdir -p /var/spool/cron/crontabs

RUN docker-php-ext-configure imap --with-imap --with-imap-ssl --with-kerberos \
&& docker-php-ext-configure opcache --enable-opcache \
&& docker-php-ext-install imap intl mbstring mysqli pdo_mysql zip opcache bcmath \
&& docker-php-ext-enable imap intl mbstring mysqli pdo_mysql zip opcache bcmath
# Install PHP extensions
RUN set -ex; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libc-client-dev \
libfreetype6-dev \
libicu-dev \
libjpeg62-turbo-dev \
libkrb5-dev \
libpng-dev \
libssl-dev \
; \
\
docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \
docker-php-ext-configure imap --with-imap --with-imap-ssl --with-kerberos; \
docker-php-ext-install -j "$(nproc)" \
bcmath \
imap \
intl \
mysqli \
opcache \
pdo_mysql \
zip \
; \
\
# 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/*

# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
Expand All @@ -49,25 +80,24 @@ ENV PHP_INI_DATE_TIMEZONE='UTC' \
PHP_MAX_EXECUTION_TIME=300

# Download package and extract to web volume
RUN curl -o mautic.zip -SL https://github.com/mautic/mautic/releases/download/${MAUTIC_VERSION}/${MAUTIC_VERSION}.zip \
&& echo "$MAUTIC_SHA1 *mautic.zip" | sha1sum -c - \
&& mkdir /usr/src/mautic \
&& unzip mautic.zip -d /usr/src/mautic \
&& rm mautic.zip \
&& chown -R www-data:www-data /usr/src/mautic
RUN set -ex; \
curl -o mautic.zip -fsSL https://github.com/mautic/mautic/releases/download/${MAUTIC_VERSION}/${MAUTIC_VERSION}.zip; \
echo "$MAUTIC_SHA1 *mautic.zip" | sha1sum -c -; \
mkdir /usr/src/mautic; \
busybox unzip mautic.zip -qd /usr/src/mautic; \
rm mautic.zip; \
chown -R www-data:www-data /usr/src/mautic

# Copy init scripts and custom .htaccess
COPY docker-entrypoint.sh /entrypoint.sh
COPY makeconfig.php /makeconfig.php
COPY makedb.php /makedb.php
COPY mautic.crontab /etc/cron.d/mautic
RUN chmod 644 /etc/cron.d/mautic
COPY mautic.crontab /var/spool/cron/crontabs/www-data

# Enable Apache Rewrite Module
RUN a2enmod rewrite

# Apply necessary permissions
RUN ["chmod", "+x", "/entrypoint.sh"]
ENTRYPOINT ["/entrypoint.sh"]

CMD ["apache2-foreground"]
26 changes: 13 additions & 13 deletions beta-apache/docker-entrypoint.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -47,42 +47,42 @@ fi
#ENABLES HUBSPOT CRON
if [ -n "$MAUTIC_CRON_HUBSPOT" ]; then
echo >&2 "CRON: Activating Hubspot"
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:fetchleads --integration=Hubspot > /var/log/cron.pipe 2>&1" >> /etc/cron.d/mautic
echo "15,45 * * * * www-data php /var/www/html/app/console mautic:integration:pushactivity --integration=Hubspot > /var/log/cron.pipe 2>&1" >> /etc/cron.d/mautic
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:fetchleads --integration=Hubspot > /var/log/cron.pipe 2>&1" >> /var/spool/cron/crontabs/www-data
echo "15,45 * * * * www-data php /var/www/html/app/console mautic:integration:pushactivity --integration=Hubspot > /var/log/cron.pipe 2>&1" >> /var/spool/cron/crontabs/www-data
fi

#ENABLES SALESFORCE CRON
if [ -n "$MAUTIC_CRON_SALESFORCE" ]; then
echo >&2 "CRON: Activating Salesforce"
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:fetchleads --integration=Salesforce > /var/log/cron.pipe 2>&1" >> /etc/cron.d/mautic
echo "12,42 * * * * www-data php /var/www/html/app/console mautic:integration:pushactivity --integration=Salesforce > /var/log/cron.pipe 2>&1" >> /etc/cron.d/mautic
echo "14,44 * * * * www-data php /var/www/html/app/console mautic:integration:pushleadactivity --integration=Salesforce > /var/log/cron.pipe 2>&1" >> /etc/cron.d/mautic
echo "16,46 * * * * www-data php /var/www/html/app/console mautic:integration:synccontacts --integration=Salesforce > /var/log/cron.pipe 2>&1" >> /etc/cron.d/mautic
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:fetchleads --integration=Salesforce > /var/log/cron.pipe 2>&1" >> /var/spool/cron/crontabs/www-data
echo "12,42 * * * * www-data php /var/www/html/app/console mautic:integration:pushactivity --integration=Salesforce > /var/log/cron.pipe 2>&1" >> /var/spool/cron/crontabs/www-data
echo "14,44 * * * * www-data php /var/www/html/app/console mautic:integration:pushleadactivity --integration=Salesforce > /var/log/cron.pipe 2>&1" >> /var/spool/cron/crontabs/www-data
echo "16,46 * * * * www-data php /var/www/html/app/console mautic:integration:synccontacts --integration=Salesforce > /var/log/cron.pipe 2>&1" >> /var/spool/cron/crontabs/www-data
fi

#ENABLES SUGARCRM CRON
if [ -n "$MAUTIC_CRON_SUGARCRM" ]; then
echo >&2 "CRON: Activating SugarCRM"
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:fetchleads --fetch-all --integration=Sugarcrm > /var/log/cron.pipe 2>&1" >> /etc/cron.d/mautic
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:fetchleads --fetch-all --integration=Sugarcrm > /var/log/cron.pipe 2>&1" >> /var/spool/cron/crontabs/www-data
fi

#ENABLES PIPEDRIVE CRON
if [ -n "$MAUTIC_CRON_PIPEDRIVE" ]; then
echo >&2 "CRON: Activating Pipedrive"
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:pipedrive:fetch > /var/log/cron.pipe 2>&1" >> /etc/cron.d/mautic
echo "15,45 * * * * www-data php /var/www/html/app/console mautic:integration:pipedrive:push > /var/log/cron.pipe 2>&1" >> /etc/cron.d/mautic
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:pipedrive:fetch > /var/log/cron.pipe 2>&1" >> /var/spool/cron/crontabs/www-data
echo "15,45 * * * * www-data php /var/www/html/app/console mautic:integration:pipedrive:push > /var/log/cron.pipe 2>&1" >> /var/spool/cron/crontabs/www-data
fi

#ENABLES ZOHO CRON
if [ -n "$MAUTIC_CRON_ZOHO" ]; then
echo >&2 "CRON: Activating ZohoCRM"
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:fetchleads --integration=Zoho > /var/log/cron.pipe 2>&1" >> /etc/cron.d/mautic
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:fetchleads --integration=Zoho > /var/log/cron.pipe 2>&1" >> /var/spool/cron/crontabs/www-data
fi

#ENABLES DYNAMICS CRON
if [ -n "$MAUTIC_CRON_DYNAMICS" ]; then
echo >&2 "CRON: Activating DynamicsCRM"
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:fetchleads -i Dynamics > /var/log/cron.pipe 2>&1" >> /etc/cron.d/mautic
echo "10,40 * * * * www-data php /var/www/html/app/console mautic:integration:fetchleads -i Dynamics > /var/log/cron.pipe 2>&1" >> /var/spool/cron/crontabs/www-data
fi

if ! [ -e index.php -a -e app/AppKernel.php ]; then
Expand Down Expand Up @@ -127,7 +127,7 @@ if [[ "$MAUTIC_RUN_CRON_JOBS" == "true" ]]; then
fi
(tail -f /var/log/cron.pipe | while read line; do echo "[CRON] $line"; done) &
CRONLOGPID=$!
cron -f &
busybox crond -f &
CRONPID=$!
else
echo >&2 "Not running cron as requested."
Expand All @@ -140,7 +140,7 @@ echo >&2 "======================================================================
# Github Pull Tester
if [ -n "$MAUTIC_TESTER" ]; then
echo >&2 "Copying Mautic Github Pull Tester"
wget https://raw.githubusercontent.com/mautic/mautic-tester/master/tester.php
curl -fsSOL https://raw.githubusercontent.com/mautic/mautic-tester/master/tester.php
fi


Expand Down
Loading