File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ services:
1717 - type : bind
1818 source : ./php-fpm/php-fpm.d/z-www.conf
1919 target : ' ${PHP_INI_DIR_PREFIX}/php-fpm.d/z-www.conf'
20+ - type : bind
21+ source : ./packagecheck.sh
22+ target : ' /tmp/packagecheck.sh'
2023 hostname : laravel
2124 restart : unless-stopped
2225 ports :
@@ -35,7 +38,7 @@ services:
3538 labels :
3639 - ' docker-volume-backup.stop-during-backup=true'
3740 command : >
38- bash -c "apt-get -y update && apt-get install -y zip unzip libicu-dev && docker-php-ext- install pdo_mysql intl && if pecl install -p -- redis; then pecl install -o -f redis && rm -rf /tmp/pear && docker-php-ext-enable redis; fi; curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer &&
41+ bash -c "apt-get -y update && sh /tmp/packagecheck.sh ' zip unzip' && curl -sSL https://github.com/mlocati/ docker-php-extension-installer/releases/latest/download/ install-php-extensions -o - | sh -s intl pdo_mysql && if pecl install -p -- redis; then pecl install -o -f redis && rm -rf /tmp/pear && docker-php-ext-enable redis; fi; curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer &&
3942 if [ -f \"${WEBSERVER_DOC_ROOT}/webapp/.env\" ]; then composer update --working-dir=${WEBSERVER_DOC_ROOT}/webapp; else composer create-project laravel/laravel webapp && chmod -R 777 ${WEBSERVER_DOC_ROOT}/webapp/storage/framework ${WEBSERVER_DOC_ROOT}/webapp/storage/logs; fi;
4043 sed -i \"s/DB_HOST=127.0.0.1/DB_HOST=database/;s/REDIS_HOST=127.0.0.1/REDIS_HOST=redis/\" ${WEBSERVER_DOC_ROOT}/webapp/.env; grep -qe 'date.timezone = ${LOCAL_TIMEZONE}' ${PHP_INI_DIR_PREFIX}/php/conf.d/security.ini || echo 'date.timezone = ${LOCAL_TIMEZONE}' >> ${PHP_INI_DIR_PREFIX}/php/conf.d/security.ini; php-fpm"
4144
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ PACKAGES=$1
4+
5+ notinstall_pkgs=" "
6+ install=false
7+
8+ for pkg in $PACKAGES ; do
9+ status=" $( dpkg-query -W --showformat=' ${db:Status-Status}' " $pkg " 2>&1 ) "
10+ if [ ! $? = 0 ] || [ ! " $status " = installed ]; then
11+ install=true
12+ notinstall_pkgs=$pkg " " $notinstall_pkgs
13+ else
14+ installed_pkgs=$pkg " " $installed_pkgs
15+ fi
16+ done
17+
18+ if " $install " ; then
19+ apt-get install -y --no-install-recommends $notinstall_pkgs && rm -rf /var/lib/apt/lists/*
20+ else
21+ echo " ### WARNING ${installed_pkgs} Package[s] already installed. ###"
22+ fi
You can’t perform that action at this time.
0 commit comments