File tree Expand file tree Collapse file tree 11 files changed +198
-3
lines changed Expand file tree Collapse file tree 11 files changed +198
-3
lines changed Original file line number Diff line number Diff line change
1
+ # MariaDB database server configuration file.
2
+ #
3
+ # You can use this file to overwrite the default configuration
4
+ #
5
+ # For explanations see
6
+ # http://dev.mysql.com/doc/mysql/en/server-system-variables.html
Original file line number Diff line number Diff line change
1
+ FROM drupal:8-apache-buster
2
+
3
+ # Installing additional dependencies.
4
+ RUN set -eux; \
5
+ apt update; \
6
+ apt install libxml2-dev git -y; \
7
+ docker-php-ext-install mysqli soap; \
8
+ curl -fsSL "https://github.com/drush-ops/drush-launcher/releases/latest/download/drush.phar" -o /usr/local/bin/drush && chmod +x /usr/local/bin/drush
9
+
10
+ # Removing standard Drupal core and loading OS2Web project.
11
+ WORKDIR /opt
12
+ # Getting recent state of master branch.
13
+ ARG OS2WEB_TAG
14
+ RUN set -eux; \
15
+ rm -rf drupal; \
16
+ git clone --single-branch --branch master https://github.com/OS2web/os2web8.git drupal
17
+ WORKDIR /opt/drupal
18
+
19
+ # Loading composer dependencies and configuring project folders.
20
+ RUN set -eux; \
21
+ export COMPOSER_HOME="$(mktemp -d)" ; \
22
+ composer global require hirak/prestissimo;\
23
+ COMPOSER_MEMORY_LIMIT=-1 composer install; \
24
+ chown -R www-data:www-data web/sites web/modules web/themes; \
25
+ # delete composer cache.
26
+ rm -rf "$COMPOSER_HOME"
27
+
28
+ # Adding further site specific data to image.
29
+ RUN echo '<?php $settings["project_env"] = PROD_ENV; ' > /opt/drupal/web/sites/default/env.settings.php; \
30
+ # Adding files directories.
31
+ mkdir -p files; \
32
+ rm -rf /opt/drupal/web/sites/default/files; \
33
+ ln -sf /opt/drupal/files /opt/drupal/web/sites/default/files; \
34
+ mkdir -p private; \
35
+ chown -R www-data:www-data /opt/drupal/private /opt/drupal/files
36
+
37
+ COPY settings/prod.settings.php /opt/drupal/web/sites/default/
38
+ COPY entrypoint.sh /
39
+
40
+ ENTRYPOINT ["/entrypoint.sh" ]
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ docker build ./ -t os2web
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ if [ " $WAIT_ON_MYSQL " = true ]; then
3
+ echo " Waiting mysql service 10s"
4
+ sleep 10
5
+ fi ;
6
+
7
+ if [ " $PRINT_STATUS " = true ]; then
8
+ echo " drush status"
9
+ export DRUSH=" drush --root=/opt/drupal"
10
+ $DRUSH status
11
+ fi ;
12
+
13
+ if [ " $INSTALL_OS2WEB " = true ]; then
14
+ echo " Installing new OS2Web installation"
15
+ export DRUSH=" drush --root=/opt/drupal"
16
+ # Install drupal.
17
+ $DRUSH sql-drop -y
18
+ $DRUSH si os2web --account-pass=admin --locale=da -y
19
+
20
+ # Enable theme.
21
+ if [ -z " $OS2WEB_THEME " ]; then
22
+ export OS2WEB_THEME=" fds_custom_theme"
23
+ fi ;
24
+ $DRUSH theme:enable $OS2WEB_THEME -y
25
+ $DRUSH config-set system.theme default $OS2WEB_THEME -y
26
+
27
+ # Enable modules.
28
+ $DRUSH en -y os2web_pagebuilder os2web_spotbox
29
+ else
30
+ echo " Updating project files skipped"
31
+ fi ;
32
+
33
+ if [ " $DEPLOYMENT " = true ]; then
34
+ echo " Running deployment"
35
+ export DRUSH=" drush --root=/opt/drupal"
36
+ $DRUSH cr
37
+ $DRUSH updb -y
38
+ else
39
+ echo " Deployment skipped"
40
+ fi ;
41
+
42
+ apache2-foreground
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * @file
4
+ * Local development override configuration feature.
5
+ *
6
+ * To activate this feature, copy and rename it such that its path plus
7
+ * filename is 'sites/default/settings.local.php'. Then, go to the bottom of
8
+ * 'sites/default/settings.php' and uncomment the commented lines that mention
9
+ * 'settings.local.php'.
10
+ *
11
+ * If you are using a site name in the path, such as 'sites/example.com', copy
12
+ * this file to 'sites/example.com/settings.local.php', and uncomment the lines
13
+ * at the bottom of 'sites/example.com/settings.php'.
14
+ */
15
+
16
+ $ databases ['default ' ]['default ' ] = [
17
+ 'database ' => getenv ('MYSQL_DATABASE ' ),
18
+ 'driver ' => 'mysql ' ,
19
+ 'host ' => getenv ('MYSQL_HOSTNAME ' ),
20
+ 'namespace ' => 'Drupal \\Core \\Database \\Driver \\mysql ' ,
21
+ 'password ' => getenv ('MYSQL_PASSWORD ' ),
22
+ 'port ' => getenv ('MYSQL_PORT ' ),
23
+ 'prefix ' => '' ,
24
+ 'username ' => getenv ('MYSQL_USER ' ),
25
+ ];
26
+
27
+ $ settings ['hash_salt ' ] = getenv ('DRUPAL_HASH_SALT ' );
28
+
29
+ $ settings ['file_temp_path ' ] = '/tmp ' ;
30
+ $ settings ['file_private_path ' ] = '../private ' ;
31
+
Original file line number Diff line number Diff line change 22
22
# MYSQL_PASSWORD=
23
23
# MYSQL_PORT=
24
24
# MYSQL_USER=
25
-
26
- # Another common use case is to set Drush's --uri via environment.
27
- # DRUSH_OPTIONS_URI=http://example.com
25
+ # DRUPAL_HASH_SALT=
26
+ # OS2WEB_THEME=
Original file line number Diff line number Diff line change 16
16
17
17
# Ignore Drupal's file directory
18
18
/web /sites /* /files /
19
+ /files
20
+ ! /files /.gitkeep
21
+ /private
22
+ ! /private /.gitkeep
19
23
20
24
# Ignore config files. Accordingly to bussines requirements we should not store
21
25
# configuration files in git.
40
44
* .log
41
45
* .sql
42
46
* .sql.gz
47
+
48
+ # docker/docksal
49
+ logs /* .log
50
+ .docker /logs /* .log
51
+ .docker /php /logs /* .log
52
+ .docker /mariadb /data /*
53
+ ! .docker /mariadb /data /.gitkeep
You can’t perform that action at this time.
0 commit comments