Skip to content

Commit 727c9f9

Browse files
committed
Merge branch 'kirtangajjar-fix-redis-site' into develop
2 parents 7e4f1f8 + 36d69bb commit 727c9f9

File tree

4 files changed

+30
-12
lines changed

4 files changed

+30
-12
lines changed

features/site.feature

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,23 @@ Feature: Site Command
4848
| header |
4949
| HTTP/1.1 200 OK |
5050

51+
Scenario: Create wp site successfully
52+
When I run 'bin/ee site create wpcache.test --type=wp --cache'
53+
Then After delay of 5 seconds
54+
And The site 'wpcache.test' should have webroot
55+
And The site 'wpcache.test' should have WordPress
56+
And Request on 'wpcache.test' should contain following headers:
57+
| header |
58+
| HTTP/1.1 200 OK |
59+
5160
Scenario: List the sites
5261
When I run 'bin/ee site list --format=text'
5362
Then STDOUT should return exactly
5463
"""
5564
wp.test
5665
wpsubdir.test
5766
wpsubdom.test
67+
wpcache.test
5868
"""
5969

6070
Scenario: Delete the sites

src/Site_WP_Docker.php

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,28 @@ public function generate_docker_compose_yml( array $filters = [] ) {
5353
// PHP configuration.
5454
$php['service_name'] = [ 'name' => 'php' ];
5555
$php['image'] = [ 'name' => 'easyengine/php:' . $img_versions['easyengine/php'] ];
56-
$php['depends_on'] = [ 'name' => 'db' ];
57-
$php['restart'] = $restart_default;
58-
$php['labels'] = [
56+
57+
$php['depends_on']['dependency'][] = [ 'name' => 'db' ];
58+
59+
if ( in_array( 'redis', $filters, true ) ) {
60+
$php['depends_on']['dependency'][] = [ 'name' => 'redis' ];
61+
}
62+
63+
$php['restart'] = $restart_default;
64+
$php['labels'] = [
5965
'label' => [
6066
'name' => 'io.easyengine.site=${VIRTUAL_HOST}',
6167
],
6268
];
63-
$php['volumes'] = [
69+
$php['volumes'] = [
6470
[
6571
'vol' => [
6672
[ 'name' => './app/src:/var/www/htdocs' ],
6773
[ 'name' => './config/php-fpm/php.ini:/usr/local/etc/php/php.ini' ],
6874
],
6975
],
7076
];
71-
$php['environment'] = [
77+
$php['environment'] = [
7278
'env' => [
7379
[ 'name' => 'WORDPRESS_DB_HOST' ],
7480
[ 'name' => 'WORDPRESS_DB_NAME' ],
@@ -79,13 +85,13 @@ public function generate_docker_compose_yml( array $filters = [] ) {
7985
[ 'name' => 'VIRTUAL_HOST' ],
8086
],
8187
];
82-
$php['networks'] = $network_default;
88+
$php['networks'] = $network_default;
8389

8490
// nginx configuration.
85-
$nginx['service_name'] = [ 'name' => 'nginx' ];
86-
$nginx['image'] = [ 'name' => 'easyengine/nginx:' . $img_versions['easyengine/nginx'] ];
87-
$nginx['depends_on'] = [ 'name' => 'php' ];
88-
$nginx['restart'] = $restart_default;
91+
$nginx['service_name'] = [ 'name' => 'nginx' ];
92+
$nginx['image'] = [ 'name' => 'easyengine/nginx:' . $img_versions['easyengine/nginx'] ];
93+
$nginx['depends_on']['dependency'][] = [ 'name' => 'php' ];
94+
$nginx['restart'] = $restart_default;
8995

9096
$v_host = in_array( 'subdom', $filters, true ) ? 'VIRTUAL_HOST=${VIRTUAL_HOST},*.${VIRTUAL_HOST}' : 'VIRTUAL_HOST';
9197

templates/config/nginx/default.conf.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ server {
2222
set $skip 1;
2323
}
2424
# Don't cache URL containing the following segments
25-
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*.php|index.php|/feed/|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
25+
if ($request_uri ~* "(/ee-admin/|/wp-admin/|/xmlrpc.php|wp-.*.php|index.php|/feed/|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
2626
set $skip 1;
2727
}
2828
# Don't use the cache for logged in users or recent commenter or customer with items in cart
@@ -159,7 +159,7 @@ server {
159159
access_log off;
160160
log_not_found off;
161161
}
162-
162+
163163
# Deny backup extensions & log files
164164
location ~* ^.+\.(bak|log|old|orig|original|php#|php~|php_bak|save|swo|swp|sql)$ {
165165
deny all;

templates/docker-compose.mustache

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ services:
1414
{{/hostname}}
1515
{{#depends_on}}
1616
depends_on:
17+
{{#dependency}}
1718
- {{name}}
19+
{{/dependency}}
1820
{{/depends_on}}
1921
{{#restart}}
2022
restart: {{name}}

0 commit comments

Comments
 (0)