Skip to content

Commit 4ed8771

Browse files
committed
Added aakbcms template
1 parent 74865cc commit 4ed8771

File tree

3 files changed

+254
-0
lines changed

3 files changed

+254
-0
lines changed
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# @see https://www.nginx.com/resources/wiki/start/topics/recipes/drupal/
2+
server {
3+
listen 80;
4+
server_name localhost;
5+
6+
root /app;
7+
8+
location = /favicon.ico {
9+
log_not_found off;
10+
access_log off;
11+
}
12+
13+
location = /robots.txt {
14+
allow all;
15+
log_not_found off;
16+
access_log off;
17+
}
18+
19+
# Very rarely should these ever be accessed outside of your lan
20+
location ~* \.(txt|log)$ {
21+
allow 192.168.0.0/16;
22+
deny all;
23+
}
24+
25+
location ~ \..*/.*\.php$ {
26+
return 403;
27+
}
28+
29+
location ~ ^/sites/.*/private/ {
30+
return 403;
31+
}
32+
33+
# Block access to scripts in site files directory
34+
location ~ ^/sites/[^/]+/files/.*\.php$ {
35+
deny all;
36+
}
37+
38+
# Allow "Well-Known URIs" as per RFC 5785
39+
location ~* ^/.well-known/ {
40+
allow all;
41+
}
42+
43+
# Block access to "hidden" files and directories whose names begin with a
44+
# period. This includes directories used by version control systems such
45+
# as Subversion or Git to store control files.
46+
location ~ (^|/)\. {
47+
return 403;
48+
}
49+
50+
location / {
51+
# try_files $uri @rewrite; # For Drupal <= 6
52+
try_files $uri /index.php?$query_string; # For Drupal >= 7
53+
}
54+
55+
location @rewrite {
56+
rewrite ^/(.*)$ /index.php?q=$1;
57+
}
58+
59+
# Don't allow direct access to PHP files in the vendor directory.
60+
location ~ /vendor/.*\.php$ {
61+
deny all;
62+
return 404;
63+
}
64+
65+
# In Drupal 8, we must also match new paths where the '.php' appears in
66+
# the middle, such as update.php/selection. The rule we use is strict,
67+
# and only allows this pattern with the update.php front controller.
68+
# This allows legacy path aliases in the form of
69+
# blog/index.php/legacy-path to continue to route to Drupal nodes. If
70+
# you do not have any paths like that, then you might prefer to use a
71+
# laxer rule, such as:
72+
# location ~ \.php(/|$) {
73+
# The laxer rule will continue to work if Drupal uses this new URL
74+
# pattern with front controllers other than update.php in a future
75+
# release.
76+
location ~ '\.php$|^/update.php' {
77+
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
78+
# Security note: If you're running a version of PHP older than the
79+
# latest 5.3, you should have "cgi.fix_pathinfo = 0;" in php.ini.
80+
# See http://serverfault.com/q/627903/94922 for details.
81+
include fastcgi_params;
82+
# Block httpoxy attacks. See https://httpoxy.org/.
83+
fastcgi_param HTTP_PROXY "";
84+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
85+
fastcgi_param PATH_INFO $fastcgi_path_info;
86+
fastcgi_param QUERY_STRING $query_string;
87+
fastcgi_intercept_errors on;
88+
fastcgi_param PHP_VALUE "memory_limit = 512M";
89+
fastcgi_pass phpfpm:9000;
90+
fastcgi_send_timeout 300;
91+
fastcgi_read_timeout 300;
92+
}
93+
94+
# Fighting with Styles? This little gem is amazing.
95+
# location ~ ^/sites/.*/files/imagecache/ { # For Drupal <= 6
96+
location ~ ^/sites/.*/files/styles/ { # For Drupal >= 7
97+
try_files $uri @rewrite;
98+
}
99+
100+
# Handle private files through Drupal. Private file's path can come
101+
# with a language prefix.
102+
location ~ ^(/[a-z\-]+)?/system/files/ { # For Drupal >= 7
103+
try_files $uri /index.php?$query_string;
104+
}
105+
106+
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
107+
try_files $uri @rewrite;
108+
expires max;
109+
log_not_found off;
110+
}
111+
}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
version: "3"
2+
3+
networks:
4+
frontend:
5+
external: true
6+
app:
7+
driver: bridge
8+
internal: false
9+
10+
services:
11+
mariadb:
12+
image: itkdev/mariadb:latest
13+
networks:
14+
- app
15+
ports:
16+
- '3306'
17+
environment:
18+
- MYSQL_ROOT_PASSWORD=password
19+
- MYSQL_USER=db
20+
- MYSQL_PASSWORD=db
21+
- MYSQL_DATABASE=db
22+
23+
phpfpm:
24+
image: itkdev/php7.0-fpm:latest
25+
networks:
26+
- app
27+
environment:
28+
- PHP_XDEBUG=${PHP_XDEBUG:-0}
29+
- PHP_XDEBUG_REMOTE_AUTOSTART=${PHP_XDEBUG_REMOTE_AUTOSTART:-0}
30+
- PHP_XDEBUG_REMOTE_CONNECT_BACK=${PHP_XDEBUG_REMOTE_CONNECT_BACK:-0}
31+
- PHP_MAX_EXECUTION_TIME=300
32+
- PHP_MEMORY_LIMIT=512M
33+
# - PHP_MAIL=1 # Uncomment to enable mailhog.
34+
- DOCKER_HOST_DOMAIN=${COMPOSE_DOMAIN}
35+
depends_on:
36+
- mariadb
37+
volumes:
38+
- .:/app:delegated
39+
- drush-cache:/root/.drush
40+
41+
nginx:
42+
image: nginx:latest
43+
networks:
44+
- app
45+
- frontend
46+
depends_on:
47+
- phpfpm
48+
- memcached
49+
ports:
50+
- '80'
51+
volumes:
52+
- ${PWD}/.docker/vhost.conf:/etc/nginx/conf.d/default.conf:ro
53+
- ./:/app:delegated
54+
labels:
55+
- "traefik.enable=true"
56+
- "traefik.docker.network=frontend"
57+
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${COMPOSE_DOMAIN}`)"
58+
59+
memcached:
60+
image: 'memcached:latest'
61+
networks:
62+
- app
63+
ports:
64+
- '11211'
65+
environment:
66+
- MEMCACHED_CACHE_SIZE=64
67+
68+
mailhog:
69+
image: mailhog/mailhog
70+
networks:
71+
- app
72+
ports:
73+
- "1025"
74+
- "8025"
75+
76+
drush:
77+
image: itkdev/drush6:latest
78+
networks:
79+
- app
80+
depends_on:
81+
- mariadb
82+
entrypoint:
83+
- drush
84+
volumes:
85+
- drush-cache:/root/.drush
86+
- ./:/app
87+
88+
node:
89+
image: node:6
90+
networks:
91+
- app
92+
volumes:
93+
- .:/app:delegated
94+
95+
# Drush cache volume to persist cache between runs.
96+
volumes:
97+
drush-cache:
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
$databases = array (
4+
'default' =>
5+
array (
6+
'default' =>
7+
array (
8+
'database' => 'db',
9+
'username' => 'db',
10+
'password' => 'db',
11+
'host' => 'mariadb',
12+
'port' => '',
13+
'driver' => 'mysql',
14+
'prefix' => '',
15+
),
16+
),
17+
);
18+
19+
$update_free_access = FALSE;
20+
21+
ini_set('session.gc_probability', 1);
22+
ini_set('session.gc_divisor', 100);
23+
ini_set('session.gc_maxlifetime', 200000);
24+
ini_set('session.cookie_lifetime', 2000000);
25+
26+
$conf['404_fast_paths_exclude'] = '/\/(?:styles)|(?:system\/files)\//';
27+
$conf['404_fast_paths'] = '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i';
28+
$conf['404_fast_html'] = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL "@path" was not found on this server.</p></body></html>';
29+
30+
/**
31+
* Memcached configuration.
32+
*/
33+
include_once('./includes/cache.inc');
34+
include_once('./profiles/ding2/modules/contrib/memcache/memcache.inc');
35+
// Forms cache table.
36+
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
37+
$conf['cache_backends'][] = 'profiles/ding2/modules/contrib/memcache/memcache.inc';
38+
$conf['cache_default_class'] = 'MemCacheDrupal';
39+
$conf['memcache_key_prefix'] = $databases['default']['default']['database'];
40+
$conf['memcache_servers'] = array(
41+
'memcached:11211' => 'default',
42+
);
43+
$conf['memcache_bins'] = array(
44+
'cache' => 'default',
45+
);
46+
$conf['memcache_log_data_pieces'] = 10;

0 commit comments

Comments
 (0)