Skip to content

Commit c4df206

Browse files
committed
BKDK-521 Adjustemts for os2web-subsites
1 parent 25f3d97 commit c4df206

File tree

8 files changed

+74
-18
lines changed

8 files changed

+74
-18
lines changed

.docker/os2web-subsites/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.env
22
volumes/*
33
!volumes/.keep
4+
logs/*
5+
!logs/.keep

.docker/os2web-subsites/Dockerfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,9 @@ RUN set -eux; \
1515

1616
# Adding subsites provisioner script.
1717
RUN set -eux; \
18-
sed -i "s/\"installer-paths\": {/\"installer-paths\": {\"scripts\/{\$name\}\": \[\"bellcom\/os2subsites_provision\"\],/g" composer.json; \
19-
export COMPOSER_HOME="$(mktemp -d)"; \
20-
echo "Loading bellcom/os2subsites_provision 05042022"; \
21-
composer require bellcom/os2subsites_provision:dev-master; \
22-
ln -s /opt/drupal/scripts/os2subsites_provision/8.x/bc_subsites /opt/drupal/web/modules/custom/; \
23-
# delete composer cache.
24-
rm -rf "$COMPOSER_HOME"
18+
git clone -n https://github.com/bellcom/os2subsite_provision.git /opt/drupal/scripts/os2subsites_provision; \
19+
cd /opt/drupal/scripts/os2subsites_provision && git checkout e1288f4a62ca94f191c17f9d497bd9fda9a82f61; \
20+
ln -s /opt/drupal/scripts/os2subsites_provision/8.x/bc_subsites /opt/drupal/web/modules/custom/
2521

2622
# Adding further site specific data to image.
2723
RUN chown -R www-data:www-data /opt/drupal/tmp /opt/drupal/logs /opt/drupal/translations; \
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<VirtualHost *:80>
2+
<Directory /opt/drupal>
3+
AllowOverride All
4+
Options FollowSymLinks
5+
</Directory>
6+
7+
ServerAdmin [email protected]
8+
DocumentRoot /var/www/html
9+
10+
ErrorLog ${APACHE_LOG_DIR}/error.log
11+
CustomLog ${APACHE_LOG_DIR}/access.log combined
12+
13+
SetEnvIf X-Forwarded-Proto https HTTPS=on
14+
15+
php_admin_value open_basedir /opt/drupal:/usr/share/php
16+
php_value include_path .:/opt/drupal
17+
18+
php_value log_errors 1
19+
php_value html_errors 0
20+
php_value display_errors 0
21+
php_admin_value error_reporting 1023
22+
php_value error_log /dev/stderr
23+
24+
php_value session.save_path /opt/drupal/sessions
25+
php_admin_value upload_max_filesize 128M
26+
php_admin_value post_max_size 128M
27+
php_admin_value upload_tmp_dir /opt/drupal/tmp/default
28+
</VirtualHost>

.docker/os2web-subsites/apache/os2subsites-vhost-template

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,18 @@
33
<Directory [basedir]>
44
AllowOverride All
55
Options FollowSymLinks
6-
# Uncommenting below will only allow a limited number of Bellcom IPs access to the site
7-
#Include /etc/apache2/limit-bellcom.conf
8-
# Below blocks access without auth if the domain ends with bellcom.dk
9-
#Include /etc/apache2/limit-subsite-access.conf
106
</Directory>
117

128
ServerAdmin [email protected]
13-
DocumentRoot [basedir]/public_html
9+
DocumentRoot /var/www/html
1410
ServerName [domain]
1511

1612
CustomLog ${APACHE_LOG_DIR}/access.log combined
1713
ErrorLog ${APACHE_LOG_DIR}/error.log
1814

1915
php_admin_value open_basedir [basedir]:/usr/share/php
2016
php_value include_path .:[basedir]
21-
php_value error_log ${APACHE_LOG_DIR}/error.log
17+
php_value error_log /dev/stderr
2218
php_value session.save_path [basedir]/sessions/[domain]
2319
php_admin_value upload_tmp_dir [basedir]/tmp/[domain]
2420

.docker/os2web-subsites/docker-compose.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ networks:
99
volumes:
1010
mysql:
1111
driver: local
12-
os2web:
13-
driver: local
1412
services:
1513

1614
# General application container.
@@ -22,8 +20,8 @@ services:
2220
- ./logs:/var/log:delegated
2321
- ./volumes/drupal/private:/opt/drupal/private
2422
- ./volumes/drupal/web/sites:/opt/drupal/web/sites
25-
- ./volumes/apache/sites-availbale:/etc/apache/sites-availbale
26-
- ./volumes/apache/sites-enabled:/etc/apache/sites-enabled
23+
- ./volumes/apache2/sites-available:/etc/apache2/sites-available
24+
- ./volumes/apache2/sites-enabled:/etc/apache2/sites-enabled
2725
- ./volumes/config:/opt/drupal/config
2826
- ./volumes/crontabs:/var/spool/cron/crontabs
2927
- ./volumes/tmp:/opt/drupal/tmp

.docker/os2web-subsites/entrypoint.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
# Starting cron service.
44
service cron start
55

6+
# Check basic file structure for subsites creator
7+
if [ ! -f "/etc/apache2/sites-available/000-default.conf" ]
8+
then
9+
cp -f /opt/drupal/.docker/os2web-subsites/apache/000-default.conf /etc/apache2/sites-available/000-default.conf
10+
ln -sf /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-enabled/000-default.conf
11+
fi
12+
613
# Check basic file structure for subsites creator
714
if [ ! -d "/opt/drupal/web/sites/default" ]
815
then
@@ -16,6 +23,35 @@ then
1623
chown -R www-data:www-data /opt/drupal/web/sites
1724
fi
1825

26+
# Check basic file structure for subsites creator
27+
if [ ! -f "/opt/drupal/web/sites/sites.php" ]
28+
then
29+
echo "Creating web/sites/sites.php"
30+
echo "<?php" > /opt/drupal/web/sites/sites.php
31+
chown www-data:www-data /opt/drupal/web/sites/sites.php
32+
fi
33+
34+
# Check default config dir
35+
if [ ! -f "/opt/drupal/config/default" ]
36+
then
37+
mkdir -p /opt/drupal/config/default
38+
chown www-data:www-data -R /opt/drupal/config
39+
fi
40+
41+
# Check default temp dir
42+
if [ ! -f "/opt/drupal/tmp/default" ]
43+
then
44+
mkdir -p /opt/drupal/tmp/default
45+
chown www-data:www-data -R /opt/drupal/tmp
46+
fi
47+
48+
# Check default private dir
49+
if [ ! -f "/opt/drupal/private/default" ]
50+
then
51+
mkdir -p /opt/drupal/private/default
52+
chown www-data:www-data -R /opt/drupal/private
53+
fi
54+
1955
# Copying shared settings file
2056
cp -f /opt/drupal/.docker/os2web-subsites/settings/shared.settings.php /opt/drupal/web/sites/shared.settings.php
2157

-11.7 KB
Binary file not shown.

.docker/os2web-subsites/settings/settings.local.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@
4646

4747
// Passing EXTERNAL_DB_PROVISIONING into Drupal settings.
4848
if (getenv('EXTERNAL_DB_PROVISIONING')) {
49-
$settings['external_db_provisioning'] = getenv('EXTERNAL_DB_PROVISIONING');
49+
$config['bc_subsites.settings']['external_db_provisioning'] = getenv('EXTERNAL_DB_PROVISIONING');
5050
}
5151

0 commit comments

Comments
 (0)