Skip to content

Commit 442a2fc

Browse files
authored
Merge branch 'develop' into fix/wildcard-db-entry
2 parents 0f76a18 + f654efb commit 442a2fc

File tree

3 files changed

+37
-10
lines changed

3 files changed

+37
-10
lines changed

src/Site_WP_Command.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ private function configure_site_files() {
323323
$env_content = EE\Utils\mustache_render( SITE_WP_TEMPLATE_ROOT . '/config/.env.mustache', $env_data );
324324
$php_ini_content = EE\Utils\mustache_render( SITE_WP_TEMPLATE_ROOT . '/config/php-fpm/php.ini.mustache', [] );
325325

326-
EE\Siteutils\add_site_redirects( $this->site['name'], $this->le );
326+
EE\SiteUtils\add_site_redirects( $this->site['name'], $this->le );
327327

328328
try {
329329
$this->fs->dumpFile( $site_docker_yml, $docker_compose_content );
@@ -333,6 +333,9 @@ private function configure_site_files() {
333333
$this->fs->dumpFile( $site_nginx_default_conf, $default_conf_content );
334334
$this->fs->mkdir( $site_conf_dir . '/php-fpm' );
335335
$this->fs->dumpFile( $site_php_ini, $php_ini_content );
336+
337+
EE\SiteUtils\set_postfix_files( $this->site['name'], $site_conf_dir );
338+
336339
EE::success( 'Configuration files copied.' );
337340
} catch ( Exception $e ) {
338341
$this->catch_clean( $e );
@@ -395,22 +398,22 @@ private function create_site( $assoc_args ) {
395398
$this->site['root'] = WEBROOT . $this->site['name'];
396399
$this->level = 1;
397400
try {
398-
EE\Siteutils\create_site_root( $this->site['root'], $this->site['name'] );
401+
EE\SiteUtils\create_site_root( $this->site['root'], $this->site['name'] );
399402
$this->level = 2;
400-
EE\Siteutils\setup_site_network( $this->site['name'] );
403+
EE\SiteUtils\setup_site_network( $this->site['name'] );
401404
$this->maybe_verify_remote_db_connection();
402405
$this->level = 3;
403406
$this->configure_site_files();
404407

405-
EE\Siteutils\start_site_containers( $this->site['root'] );
406-
408+
EE\SiteUtils\start_site_containers( $this->site['root'] );
409+
EE\SiteUtils\configure_postfix( $this->site['name'], $this->site['root'] );
407410
$this->wp_download_and_config( $assoc_args );
408411

409412
if ( ! $this->skip_install ) {
410-
EE\Siteutils\create_etc_hosts_entry( $this->site['name'] );
413+
EE\SiteUtils\create_etc_hosts_entry( $this->site['name'] );
411414
if ( ! $this->skip_chk ) {
412415
$this->level = 4;
413-
EE\Siteutils\site_status_check( $this->site['name'] );
416+
EE\SiteUtils\site_status_check( $this->site['name'] );
414417
}
415418
$this->install_wp();
416419
}

src/Site_WP_Docker.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,26 @@ public function generate_docker_compose_yml( array $filters = [] ) {
142142
];
143143
$mailhog['networks'] = $network_default;
144144

145+
// postfix configuration.
146+
$postfix['service_name'] = [ 'name' => 'postfix' ];
147+
$postfix['image'] = [ 'name' => 'easyengine/postfix:v' . EE_VERSION ];
148+
$postfix['hostname'] = [ 'name' => '${VIRTUAL_HOST}' ];
149+
$postfix['restart'] = $restart_default;
150+
$postfix['labels'] = [
151+
'label' => [
152+
'name' => 'io.easyengine.site=${VIRTUAL_HOST}',
153+
],
154+
];
155+
$postfix['volumes'] = [
156+
'vol' => [
157+
[ 'name' => '/dev/log:/dev/log' ],
158+
[ 'name' => './config/postfix/ssl:/etc/ssl/postfix' ],
159+
[ 'name' => './app/postfix/spool:/var/spool/postfix' ],
160+
],
161+
];
162+
$postfix['networks'] = $network_default;
163+
164+
145165
// redis configuration.
146166
$redis['service_name'] = [ 'name' => 'redis' ];
147167
$redis['image'] = [ 'name' => 'easyengine/redis:v' . EE_VERSION ];
@@ -160,6 +180,7 @@ public function generate_docker_compose_yml( array $filters = [] ) {
160180
$base[] = $nginx;
161181
//$base[] = $mailhog;
162182
$base[] = $phpmyadmin;
183+
$base[] = $postfix;
163184

164185
if ( in_array( 'redis', $filters, true ) ) {
165186
$base[] = $redis;

templates/docker-compose.mustache

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ services:
99
{{#image}}
1010
image: {{name}}
1111
{{/image}}
12+
{{#hostname}}
13+
hostname: {{name}}
14+
{{/hostname}}
1215
{{#depends_on}}
1316
depends_on:
1417
- {{name}}
@@ -20,7 +23,7 @@ services:
2023
command: {{name}}
2124
{{/command}}
2225
{{#labels}}
23-
labels:
26+
labels:
2427
{{#label}}
2528
- "{{name}}"
2629
{{/label}}
@@ -41,12 +44,12 @@ services:
4144
networks:
4245
- {{name}}
4346
{{/networks}}
44-
47+
4548
{{/services}}
4649

4750
{{#network}}
4851
networks:
4952
site-network:
5053
external:
5154
name: ${VIRTUAL_HOST}
52-
{{/network}}
55+
{{/network}}

0 commit comments

Comments
 (0)