Skip to content

Commit 34ef580

Browse files
authored
Merge pull request #14 from OS2web/develop
Update apache config in Docker image
2 parents fa87fba + 829bd7d commit 34ef580

File tree

14 files changed

+1391
-505
lines changed

14 files changed

+1391
-505
lines changed

.docker/os2web/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ RUN echo '<?php $settings["project_env"] = PROD_ENV; ' > /opt/drupal/web/sites/d
4343
# Adding syn directory.
4444
mkdir -p config/sync; \
4545
# Adjusting ownership
46-
chown -R www-data:www-data /opt/drupal/private /opt/drupal/files /opt/drupal/config/sync; \
46+
chown -R www-data:www-data /opt/drupal/private /opt/drupal/files /opt/drupal/config/sync /opt/drupal/tmp; \
4747
chmod g+s -R /opt/drupal/private /opt/drupal/files /opt/drupal/config/sync
4848

49+
# Adding custom apache configuration with PHP value and log settings.
50+
COPY apache/000-default.conf /etc/apache2/sites-enabled/000-default.conf
51+
52+
# Adding Drupal settings.
4953
COPY settings/prod.settings.php /opt/drupal/web/sites/default/
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<VirtualHost *:80>
2+
# The ServerName directive sets the request scheme, hostname and port that
3+
# the server uses to identify itself. This is used when creating
4+
# redirection URLs. In the context of virtual hosts, the ServerName
5+
# specifies what hostname must appear in the request's Host: header to
6+
# match this virtual host. For the default virtual host (this file) this
7+
# value is not decisive as it is used as a last resort host regardless.
8+
# However, you must set it for any further virtual host explicitly.
9+
#ServerName example.com
10+
11+
ServerAdmin webmaster@localhost
12+
DocumentRoot /var/www/html
13+
14+
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
15+
# error, crit, alert, emerg.
16+
# It is also possible to configure the loglevel for particular
17+
# modules, e.g.
18+
#LogLevel info ssl:warn
19+
20+
ErrorLog ${APACHE_LOG_DIR}/error.log
21+
CustomLog ${APACHE_LOG_DIR}/access.log combined
22+
23+
php_admin_value open_basedir /opt/drupal:/usr/share/php
24+
php_value include_path .:/opt/drupal
25+
26+
php_value log_errors 1
27+
php_value html_errors 0
28+
php_value display_errors 0
29+
php_admin_value error_reporting 1023
30+
php_value error_log /opt/drupal/logs/php.log
31+
32+
php_value session.save_path /opt/drupal/sessions
33+
php_admin_value upload_max_filesize 150
34+
php_admin_value upload_tmp_dir /opt/drupal/tmp
35+
36+
# For most configuration files from conf-available/, which are
37+
# enabled or disabled at a global level, it is possible to
38+
# include a line for only one particular virtual host. For example the
39+
# following line enables the CGI configuration for this host only
40+
# after it has been globally disabled with "a2disconf".
41+
#Include conf-available/serve-cgi-bin.conf
42+
</VirtualHost>
43+
44+
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
45+

.docker/os2web/settings/prod.settings.php

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

2727
$settings['hash_salt'] = getenv('DRUPAL_HASH_SALT');
2828

29-
$settings['file_temp_path'] = '/tmp';
29+
$settings['file_temp_path'] = '../tmp';
3030
$settings['file_private_path'] = '../private';
3131

.docker/solr/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM solr:8.5.2
2+
3+
# Copying solr core config to get abylity create project SOLR core
4+
COPY config /solr-config
5+
6+
# Initiate entrypoint for create SOLR core
7+
COPY entrypoint.sh /
8+
ENTRYPOINT ["/entrypoint.sh"]

.docker/solr/build.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
if [ $# -eq 0 ]; then
4+
echo "WARNING: There was no tag-name provided!"
5+
echo "Script usage is: './build.sh tag-name'"
6+
echo "Example: './build.sh 1.0.3'"
7+
exit 0
8+
fi
9+
10+
docker build ./ -t dkbellcom/os2web8-solr:$1
11+
12+
if [ "$2" = "--push" ]; then
13+
echo "Docker login to dkbellcom. Type password:"
14+
read -s DOCKERHUB_PASS
15+
echo "Authorization..."
16+
echo $DOCKERHUB_PASS | docker login --username dkbellcom --password-stdin
17+
18+
if [ $? -eq 0 ]; then
19+
echo "Pushing image to docker hub ..."
20+
docker push dkbellcom/os2web8-solr:$1
21+
echo "Check your image here https://hub.docker.com/repository/docker/dkbellcom/os2web8-solr/tag"
22+
else
23+
echo "Image is not pushed to docker hub :("
24+
fi;
25+
fi;

.docker/solr/entrypoint.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
if [ ! -d "/var/solr/data/os2web-core" ]; then
3+
echo "Creating SOLR core os2web-core"
4+
bin/solr start
5+
bin/solr create_core -c os2web-core -d /solr-config
6+
bin/solr stop
7+
fi
8+
9+
# Starting SOLR service.
10+
solr-foreground

.docksal/docksal.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,15 @@ services:
1414
- PMA_PASSWORD=${MYSQL_ROOT_PASSWORD:-root}
1515
labels:
1616
- io.docksal.virtual-host=pma.${VIRTUAL_HOST}
17+
18+
blackfire:
19+
extends:
20+
file: ${HOME}/.docksal/stacks/services.yml
21+
service: blackfire
22+
environment:
23+
- BLACKFIRE_LOG_LEVEL=4
24+
25+
memcached:
26+
extends:
27+
file: ${HOME}/.docksal/stacks/services.yml
28+
service: memcached

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,12 @@
4545
*.sql
4646
*.sql.gz
4747

48-
# docker/docksal
49-
logs/*.log
48+
logs/*
5049
!logs/.gitkeep
50+
tmp/*
51+
!tmp/.gitkeep
52+
sessions/*
53+
!sessions/.gitkeep
5154

5255
.docker/logs/*
5356
!.docker/logs/.gitkeep

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
"drupal/console": "^1.0.2",
5151
"drupal/core": "^8.8.0",
5252
"drupal/core-composer-scaffold": "^8.8.0",
53+
"drupal/memcache": "^2.2",
54+
"drupal/monitoring": "^1.9",
5355
"drupal/stage_file_proxy": "^1.0",
5456
"drush/drush": "^9.7.1 | ^10.0.0",
5557
"mglaman/drupal-check": "^1.1",

0 commit comments

Comments
 (0)