Skip to content

Commit 961c43a

Browse files
committed
Update docker-compose.yml
1 parent 9c7df81 commit 961c43a

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

docker-compose.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,20 @@ services:
2525
- database
2626
- redis
2727
- varnish
28+
healthcheck:
29+
test: ["CMD-SHELL", "curl -fk https://${DOMAIN_NAME} || exit 1"]
30+
interval: 10s
31+
timeout: 5s
32+
retries: 3
33+
start_period: 20s
2834
environment:
29-
DB_HOST: 'database'
30-
DB_USER: '${DB_USER}'
31-
DB_PASSWORD: '${DB_PASSWORD}'
32-
DB_NAME: '${DB_NAME}'
33-
HOME: '/tmp'
3435
TZ: '${LOCAL_TIMEZONE}'
3536
labels:
3637
- 'docker-volume-backup.stop-during-backup=true'
37-
command: bash -c "pecl install redis && rm -rf /tmp/pear && docker-php-ext-enable redis && composer require 'drupal/redis:^1.5'; composer require drush/drush; composer require 'drupal/purge:^3.4' && composer require 'drupal/purge_purger_http:^1.0'; drush en redis purge_drush purge_processor_lateruntime purge_queuer_coretags purge_processor_cron purge_tokens purge_ui purge purge_purger_http purge_purger_http_tagsheader;
38-
if [ -z \"$$(ls /opt/drupal/web)\" ]; then install -m 777 ${WEBSERVER_DOC_ROOT}/sites/default/default.settings.php ${WEBSERVER_DOC_ROOT}/sites/default/settings.php && echo -e \"\n\$$settings['trusted_host_patterns'] = [\n\t'^$$(echo \"${DOMAIN_NAME}\" | sed 's/\./\\\./g')$$',\n\t'^.+\.$$(echo \"${DOMAIN_NAME}\" | sed 's/\./\\\./g')$$',\n];\n\$$settings['redis.connection']['host'] = 'redis';\n\$$settings['redis.connection']['port'] = 6379;\n\$$settings['cache']['default'] = 'cache.backend.redis';\n\$$settings['redis.connection']['base'] = 8;\" >> ${WEBSERVER_DOC_ROOT}/sites/default/settings.php;
38+
command: >
39+
bash -c "pecl install -o -f redis && rm -rf /tmp/pear && docker-php-ext-enable redis && composer require 'drupal/redis:^1.6'; composer require drush/drush; composer require 'drupal/purge:^3.4' && composer require 'drupal/purge_purger_http:^1.0';
40+
if [ ! -f \"${WEBSERVER_DOC_ROOT}/sites/default/settings.php\" ]; then install -m 777 ${WEBSERVER_DOC_ROOT}/sites/default/default.settings.php ${WEBSERVER_DOC_ROOT}/sites/default/settings.php && sed -i 's/#/\\/\\/#/g' ${WEBSERVER_DOC_ROOT}/sites/default/settings.php &&
41+
echo -e \"\\n\\$$settings['trusted_host_patterns'] = [\\n\\t'^$$(echo \"${DOMAIN_NAME}\" | sed 's/\\./\\\\./g')$$',\\n\\t'^.+\\.$$(echo \"${DOMAIN_NAME}\" | sed 's/\\./\\\\./g')$$',\\n];\\n\\$$settings['redis.connection']['host'] = 'redis';\\n\\$$settings['redis.connection']['port'] = 6379;\\n\\$$settings['cache']['default'] = 'cache.backend.redis';\\n\\$$settings['redis.connection']['base'] = 8;\" >> ${WEBSERVER_DOC_ROOT}/sites/default/settings.php;
3942
mkdir -p -m 777 ${WEBSERVER_DOC_ROOT}/sites/default/files; fi; 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; docker-php-entrypoint 'php-fpm'"
4043
4144
webserver:
@@ -49,13 +52,13 @@ services:
4952
volumes:
5053
- 'html:${WEBSERVER_DOC_ROOT}'
5154
- type: bind
52-
source: ./nginx/nginx.conf
55+
source: ./webserver/nginx.conf
5356
target: '${NGINX_PREFIX}/nginx.conf'
5457
- type: bind
55-
source: ./nginx/templates/nginx.conf.template
58+
source: ./webserver/templates/nginx.conf.template
5659
target: '${NGINX_PREFIX}/templates/default.conf.template'
5760
- type: bind
58-
source: ./nginx/ssl-option/options-ssl-nginx.conf
61+
source: ./webserver/ssl-option/options-ssl-nginx.conf
5962
target: '${LETSENCRYPT_CONF_PREFIX}/options-ssl-nginx.conf'
6063
- type: bind
6164
source: ./ssl-conf.sh
@@ -139,9 +142,9 @@ services:
139142
- "docker-volume-backup.stop-during-backup=true"
140143
command: >
141144
bash -c "echo ${PMA_HTPASSWD_USERNAME}:phpmyadmin:$$( printf \"%s:%s:%s\" \"${PMA_HTPASSWD_USERNAME}\" \"phpmyadmin\" \"${PMA_HTPASSWD_PASSWORD}\" | md5sum | awk '{print $$1}' ) > ${PMA_CONF_FOLDER}/.htpasswd
142-
&& printf 'AuthType Digest\nAuthName \"phpmyadmin\"\nAuthDigestProvider file\nAuthUserFile ${PMA_CONF_FOLDER}/.htpasswd\nRequire valid-user\n' > ${WEBSERVER_DOC_ROOT}/.htaccess && a2enmod auth_digest;
145+
&& printf 'AuthType Digest\\nAuthName \"phpmyadmin\"\\nAuthDigestProvider file\\nAuthUserFile ${PMA_CONF_FOLDER}/.htpasswd\\nRequire valid-user\\n' > ${WEBSERVER_DOC_ROOT}/.htaccess && a2enmod auth_digest;
143146
mkdir -p ${WEBSERVER_DOC_ROOT}/../upload && chown www-data:www-data ${WEBSERVER_DOC_ROOT}/../upload && chmod a+w ${WEBSERVER_DOC_ROOT}/../upload; mkdir -p ${WEBSERVER_DOC_ROOT}/../save && chown www-data:www-data ${WEBSERVER_DOC_ROOT}/../save && chmod a+w ${WEBSERVER_DOC_ROOT}/../save;
144-
grep -qxF 'ServerName 127.0.0.1' ${APACHE_CONFDIR_PREFIX}/apache2.conf || echo -e '\nServerName 127.0.0.1' >> ${APACHE_CONFDIR_PREFIX}/apache2.conf; 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;
147+
grep -qxF 'ServerName 127.0.0.1' ${APACHE_CONFDIR_PREFIX}/apache2.conf || echo -e '\\nServerName 127.0.0.1' >> ${APACHE_CONFDIR_PREFIX}/apache2.conf; 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;
145148
a2enmod ssl && a2ensite default-ssl && a2dissite 000-default && /docker-entrypoint.sh 'apache2-foreground'"
146149
147150
database:
@@ -252,7 +255,6 @@ volumes:
252255
dtredis:
253256
name: redis-data
254257
certbot-etc:
255-
external:
256-
name: certbot-etc
258+
external: true
257259
certbot-var:
258260
name: certbot-var

0 commit comments

Comments
 (0)