@@ -23,3 +23,121 @@ Example:
23
23
```
24
24
25
25
` --push ` - when you this option build will be pushed to docker hub.
26
+
27
+ ## Local developemnt through docker
28
+
29
+ While main OS2Web solution is using Docksal for local development. It's easier for testing purposes to use bare docker-compose environment for OS2Web sibsutes.
30
+
31
+ It expects that all action would be performed on Docker subsites folder .docker/os2web-subsites
32
+
33
+
34
+ ### Restart docker stack
35
+
36
+ docker-compose down
37
+ sudo rm -rf volumes/*
38
+ docker volume rm os2web-subsites-docker-compose_mysql
39
+ docker-compose up -d
40
+ docker-compose exec php bash
41
+
42
+
43
+
44
+ ### Install subsites creator
45
+ sudo -E -u www-data drush si --account-pass=admin -y && drush en bc_subsites admin_toolbar_tools -y
46
+
47
+
48
+ ### Entironments variables
49
+
50
+ Define your .env file as it stated below
51
+ ```
52
+ #
53
+ # Copy and rename this file to .env at root of this project.
54
+ #
55
+
56
+ # Uncomment and populate as needed.
57
+ ## Subsite admin UI db creadentials
58
+ MYSQL_DATABASE=os2subsites
59
+ MYSQL_HOSTNAME=mariadb
60
+ MYSQL_ROOT_PASSWORD=root
61
+ MYSQL_PASSWORD=os2subsites
62
+ MYSQL_PORT=3306
63
+ MYSQL_USER=os2subsites
64
+
65
+ ## Drupal salt
66
+ DRUPAL_HASH_SALT=w-NR7Q2C3URQH6qdRvDPlbxVqdvyGMbsOwyXgtqkdJGNI7FBMbrD79UMx2DDNlSqvfmY-OOKLw
67
+ ## Domain suffix that would be used for subsites
68
+ DOMAIN_SUFFIX=os2subsites.local
69
+ ## Path to base site config directory
70
+ BASE_SUBSITE_CONFIG_DIR=/opt/drupal/config/ay-test0604-3.${DOMAIN_SUFFIX}/sync
71
+
72
+ # OS2SUBSITE common varaibles.
73
+ ## Flag for using environment variables
74
+ ## Comment this variale to use values from `config.sh file`
75
+ USE_ENV_CONFIG=1
76
+ ## Drupal project root directory
77
+ BASEDIR=/opt/drupal
78
+ SERVERIP=127.0.0.1
79
+ ## Default Drupal profile for subsites.
80
+ ## Use `base_config` value
81
+ PROFILE=base_config
82
+ ALLOWED_INSTALL_PROFILES=minimal,os2web
83
+ ## Email used for subsite admin user.
84
+
85
+ ## Path to
86
+ SCRIPTDIR=/opt/drupal/scripts/os2subsites_provision
87
+ ## Path to drush
88
+ DRUSH=/usr/local/bin/drush
89
+ ## Database creadentials for creating subsite db.
90
+ DBHOST=mariadb
91
+ DBUSER_HOST=mariadb
92
+ ### Optional varialbles. Leave it empty to user root as user name.
93
+ DB_ROOT_USER=root
94
+ ### Optional varialbles. Leave it empty to user root user without password from localhost.
95
+ DB_ROOT_PASSWORD=root
96
+ ## External db provisioning. NOTE: To disable external provisioning you have to JUST comment variable
97
+ EXTERNAL_DB_PROVISIONING=1
98
+ PROVISIONING_SOURCES_PATH=/opt/drupal/private/subsite-credentials
99
+ ## For internal db provisioning you have to specify directory to mysql db files are stored. It's used for db existing check.
100
+ #DBDIR=/var/lib/mysql
101
+ ## Subsite admin pass
102
+ ADMINPASS=admin
103
+ ## Path to subsite vhost template
104
+ VHOSTTEMPLATE=${SCRIPTDIR}/../os2subsites_provision/os2subsites-vhost-template
105
+ ## Drupal document root directory path
106
+ MULTISITE=${BASEDIR}/web
107
+ ## Path to file where subsites registering.
108
+ SITESFILE=${MULTISITE}/sites/sites.php
109
+ ## Temp directory for subsites
110
+ TMPDIRBASE=${BASEDIR}/tmp
111
+ ## Log directory for subsites
112
+ LOGDIRBASE=${BASEDIR}/logs
113
+ ## Session directory for subsites
114
+ SESSIONDIRBASE=${BASEDIR}/sessions
115
+ ## Username for subsite administrator user. User will be created on subsites.
116
+ SITEADMIN=subsiteadmin
117
+ ## Apache webserver username.
118
+ APACHEUSER=www-data
119
+ ## Root user name. Sometimes this variable is empty.
120
+ USER=root
121
+ # Version of Drupal core. Accepted values 7,8
122
+ DRUPAL=8
123
+ # Additional option for site-install command
124
+ INSTALL_OPTIONS=
125
+
126
+ ## Variable used only in docker-compose.yaml
127
+ COMPOSE_PROJECT_NAME=os2web-subsites-docker-compose
128
+ TAG=2.1.5-rc-BKDK-521 # <---- This value should be one you use for testing.
129
+ WEB_SERVER_PORT=8098
130
+ ```
131
+
132
+ ### Handling domains
133
+
134
+ Main domain for subsite creator is localhost:8098
135
+
136
+ NOTE: Port could be different if you changed ` WEB_SERVER_PORT ` variable.
137
+
138
+ Each subsites domain should be defined in your local ` /etc/hosts ` file like:
139
+ ```
140
+ 127.0.0.1 new-subsite.os2subsites.local
141
+ ```
142
+
143
+ NOTE: Domain suffix ` .os2subsites.local ` could be different if you changed ` DOMAIN_SUFFIX ` variable.
0 commit comments