Skip to content

Commit

Permalink
PROTO and URL_PREFIX settings
Browse files Browse the repository at this point in the history
  • Loading branch information
bercab committed Jan 8, 2015
1 parent ae69562 commit 924000f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,11 @@ Env vars (default value shown)::
-e DATABASE_HOST=172.17.42.1
-e DATABASE_PORT=3306

-e DOMAIN=hostname # Sets all hostnames config, default: container hostname.
-e BASE_URL=http://hostname # default: http://{{DOMAIN}}
-e DOMAIN=localhost # Sets all hostnames config, default: container hostname.
-e PROTO=http
-e URL_PREFIX # Default empty. If defined, must begin (but not end) with "/".
# example: -e URL_PREFIX=/mydrupal

# base_url drupal setting will be: {{PROTO}}://{{DOMAIN}}{{URL_PREFIX}}


5 changes: 4 additions & 1 deletion apache-vhost.conf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
ServerName {{ DOMAIN | default("localhost") }}
ErrorLog /app/logs/drupal-error.log
CustomLog /app/logs/drupal-access.log common
{% if URL_PREFIX %}
Alias {{URL_PREFIX}} /app/www
{% endif %}

<Directory /app/www>
Options Indexes FollowSymLinks MultiViews
Expand All @@ -26,4 +29,4 @@
order deny,allow
deny from all
</FilesMatch>
</VirtualHost>
</VirtualHost>
7 changes: 2 additions & 5 deletions settings.php.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ $databases['default']['default'] = array(
$update_free_access = FALSE;
$drupal_hash_salt = '{{ DRUPAL_HASH_SALT }}';

{% if BASE_URL is defined %}
$base_url = '{{ BASE_URL }}'; // NO trailing slash!
{% else %}
$base_url = 'http://{{ DOMAIN }}'; // NO trailing slash!
{% endif %}
// generated by container conf template
$base_url = '{{PROTO|default("http")}}://{{DOMAIN|default("localhost")}}{{URL_PREFIX|default("")}}';

ini_set('session.gc_probability', 1);
ini_set('session.gc_divisor', 100);
Expand Down

0 comments on commit 924000f

Please sign in to comment.