Skip to content

Commit a66f460

Browse files
committed
Merge branch 'develop' for v1.8.0
2 parents cd3b6a8 + bd2d589 commit a66f460

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

src/Site_WP_Docker.php

+8-6
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ public function generate_docker_compose_yml( array $filters = [], $volumes ) {
2525
$restart_default = [ 'name' => 'always' ];
2626
$network_default = [
2727
'net' => [
28-
[ 'name' => 'site-network' ],
28+
[ 'name' => $filters['site_url'] ],
2929
],
3030
];
3131

3232
$network = [
33+
'name' => $filters['site_url'],
3334
'networks_labels' => [
3435
'label' => [
3536
[ 'name' => 'org.label-schema.vendor=EasyEngine' ],
@@ -64,8 +65,9 @@ public function generate_docker_compose_yml( array $filters = [], $volumes ) {
6465
$db['sysctls'] = sysctl_parameters();
6566
$db['networks'] = $network_default;
6667
}
68+
6769
// PHP configuration.
68-
$php_image_key = ( 'latest' === $filters['php_version'] ? 'easyengine/php' : 'easyengine/php' . $filters['php_version'] );
70+
$php_image_key = ( 'latest' === $filters['php_version'] ? 'easyengine/php8.2' : 'easyengine/php' . $filters['php_version'] );
6971

7072
$php['service_name'] = [ 'name' => 'php' ];
7173
$php['image'] = [ 'name' => $php_image_key . ':' . $img_versions[ $php_image_key ] ];
@@ -108,7 +110,7 @@ public function generate_docker_compose_yml( array $filters = [], $volumes ) {
108110
$php['networks'] = [
109111
'net' => [
110112
[
111-
'name' => 'site-network',
113+
'name' => $filters['site_url'],
112114
'aliases' => [
113115
'alias' => [
114116
'name' => '${VIRTUAL_HOST}_php',
@@ -170,7 +172,7 @@ public function generate_docker_compose_yml( array $filters = [], $volumes ) {
170172
$nginx['networks'] = [
171173
'net' => [
172174
[ 'name' => 'global-frontend-network' ],
173-
[ 'name' => 'site-network' ],
175+
[ 'name' => $filters['site_url'] ],
174176
],
175177
];
176178
if ( in_array( GLOBAL_REDIS, $filters, true ) ) {
@@ -195,9 +197,9 @@ public function generate_docker_compose_yml( array $filters = [], $volumes ) {
195197
'name' => 'io.easyengine.site=${VIRTUAL_HOST}',
196198
],
197199
];
198-
$mailhog['networks'] = [
200+
$mailhog['networks'] = [
199201
'net' => [
200-
[ 'name' => 'site-network' ],
202+
[ 'name' => $filters['site_url'] ],
201203
[ 'name' => 'global-frontend-network' ],
202204
],
203205
];

src/WordPress.php

+8-7
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ public function __construct() {
131131
* : Set custom source directory for site inside htdocs.
132132
*
133133
* [--php=<php-version>]
134-
* : PHP version for site. Currently only supports PHP 5.6, 7.0, 7.2, 7.3, 7.4, 8.0, 8.1 and latest.
134+
* : PHP version for site. Currently only supports PHP 5.6, 7.0, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3 and latest.
135135
* ---
136-
* default: latest
136+
* default: 8.2
137137
* options:
138138
* - 5.6
139139
* - 7.0
@@ -142,6 +142,8 @@ public function __construct() {
142142
* - 7.4
143143
* - 8.0
144144
* - 8.1
145+
* - 8.2
146+
* - 8.3
145147
* - latest
146148
* ---
147149
*
@@ -301,7 +303,7 @@ public function create( $args, $assoc_args ) {
301303
$this->cache_type = \EE\Utils\get_flag_value( $assoc_args, 'cache' );
302304
$wildcard_flag = \EE\Utils\get_flag_value( $assoc_args, 'wildcard' );
303305
$this->site_data['site_ssl_wildcard'] = 'subdom' === $this->site_data['app_sub_type'] || $wildcard_flag ? true : false;
304-
$this->site_data['php_version'] = \EE\Utils\get_flag_value( $assoc_args, 'php', 'latest' );
306+
$this->site_data['php_version'] = \EE\Utils\get_flag_value( $assoc_args, 'php', '8.2' );
305307
$this->site_data['app_admin_url'] = \EE\Utils\get_flag_value( $assoc_args, 'title', $this->site_data['site_url'] );
306308
$this->site_data['app_admin_username'] = \EE\Utils\get_flag_value( $assoc_args, 'admin-user', \EE\Utils\random_name_generator() );
307309
$this->site_data['app_admin_password'] = \EE\Utils\get_flag_value( $assoc_args, 'admin-pass', '' );
@@ -368,7 +370,7 @@ public function create( $args, $assoc_args ) {
368370
}
369371
$this->site_data['alias_domains'] = substr( $this->site_data['alias_domains'], 0, - 1 );
370372

371-
$supported_php_versions = [ 5.6, 7.0, 7.2, 7.3, 7.4, 8.0, 8.1, 'latest' ];
373+
$supported_php_versions = [ 5.6, 7.0, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 'latest' ];
372374
if ( ! in_array( $this->site_data['php_version'], $supported_php_versions ) ) {
373375
$old_version = $this->site_data['php_version'];
374376
$floor = (int) floor( $this->site_data['php_version'] );
@@ -378,16 +380,14 @@ public function create( $args, $assoc_args ) {
378380
$this->site_data['php_version'] = 7.4;
379381
$old_version .= ' yet';
380382
} elseif ( 8 === $floor ) {
381-
$this->site_data['php_version'] = 8.0;
383+
$this->site_data['php_version'] = 8.2;
382384
$old_version .= ' yet';
383385
} else {
384386
EE::error( 'Unsupported PHP version: ' . $this->site_data['php_version'] );
385387
}
386388
\EE::confirm( sprintf( 'EEv4 does not support PHP %s. Continue with PHP %s?', $old_version, $this->site_data['php_version'] ), $assoc_args );
387389
}
388390

389-
$this->site_data['php_version'] = ( 7.4 === (double) $this->site_data['php_version'] ) ? 'latest' : $this->site_data['php_version'];
390-
391391
if ( \EE\Utils\get_flag_value( $assoc_args, 'local-db' ) ) {
392392
$this->site_data['db_host'] = 'db';
393393
}
@@ -801,6 +801,7 @@ public function dump_docker_compose_yml( $additional_filters = [] ) {
801801
$filter[] = $this->site_data['cache_host'];
802802
$filter[] = $this->site_data['db_host'];
803803
$filter['is_ssl'] = $this->site_data['site_ssl'];
804+
$filter['site_url'] = $this->site_data['site_url'];
804805
$filter['site_prefix'] = \EE_DOCKER::get_docker_style_prefix( $this->site_data['site_url'] );
805806
$filter['php_version'] = ( string ) $this->site_data['php_version'];
806807
$filter['alias_domains'] = implode( ',', array_diff( explode( ',', $this->site_data['alias_domains'] ), [ $this->site_data['site_url'] ] ) );

templates/config/nginx/main.conf.mustache

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ server {
153153
log_not_found off;
154154
}
155155
# Cache static files
156-
location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|woff2|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|swf)$ {
156+
location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|woff2|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|swf|webp)$ {
157157
add_header "Access-Control-Allow-Origin" "*";
158158
access_log off;
159159
log_not_found off;

templates/docker-compose.mustache

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.5'
2-
31
services:
42

53
{{#services}}
@@ -69,27 +67,26 @@ services:
6967
volumes:
7068
{{#external_vols}}
7169
{{ext_vol_name}}:
72-
external:
73-
name: {{prefix}}_{{ext_vol_name}}
70+
external: true
71+
name: {{prefix}}_{{ext_vol_name}}
7472
{{/external_vols}}
7573
{{/created_volumes}}
7674

7775
{{#network}}
7876
networks:
79-
site-network:
80-
name: ${VIRTUAL_HOST}
77+
{{name}}:
8178
{{#networks_labels}}
8279
labels:
8380
{{#label}}
8481
- "{{name}}"
8582
{{/label}}
8683
{{/networks_labels}}
8784
global-frontend-network:
88-
external:
89-
name: ee-global-frontend-network
85+
external: true
86+
name: ee-global-frontend-network
9087
{{#enable_backend_network}}
9188
global-backend-network:
92-
external:
93-
name: ee-global-backend-network
89+
external: true
90+
name: ee-global-backend-network
9491
{{/enable_backend_network}}
9592
{{/network}}

0 commit comments

Comments
 (0)